﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Demo JSU</title>
    <link href="style.css" rel="stylesheet" />
</head>
<body>
    <noscript><div id="noscript-padding"></div></noscript>
    <div id="notify-container"></div>
    <div id="overlay-header"></div>
    <div id="custom-header"></div>
    <div class="topbar">
        <div class="topbar-wrapper">

            <div class="js-topbar-dialog-corral">

                <div class="topbar-dialog siteSwitcher-dialog dno">
                    <div class="header">
                        <h3><a href="//stackoverflow.com">current community</a></h3>
                    </div>
                    <div class="modal-content current-site-container">
                        <ul class="current-site">
                            <li>
                                <div class="related-links">
                                    <a href="http://chat.stackoverflow.com" data-gps-track="site_switcher.click({ item_type:6 })">chat</a>
                                    <a href="http://blog.stackoverflow.com" data-gps-track="site_switcher.click({ item_type:7 })">blog</a>
                                </div>




                                <a href="//stackoverflow.com"
                                   class="current-site-link site-link js-gps-track"
                                   data-id="1"
                                   data-gps-track="
        site_switcher.click({ item_type:3 })">
                                    <div class="site-icon favicon favicon-stackoverflow" title="Stack Overflow"></div>
                                    Stack Overflow
                                </a>

                            </li>
                            <li class="related-site">
                                <div class="L-shaped-icon-container">
                                    <span class="L-shaped-icon"></span>
                                </div>





                                <a href="http://meta.stackoverflow.com"
                                   class="site-link js-gps-track"
                                   data-id="552"
                                   data-gps-track="
            site.switch({ target_site:552, item_type:3 }),
        site_switcher.click({ item_type:4 })">
                                    <div class="site-icon favicon favicon-stackoverflowmeta" title="Meta Stack Overflow"></div>
                                    Meta Stack Overflow
                                </a>

                            </li>
                            <li class="related-site">
                                <div class="L-shaped-icon-container">
                                    <span class="L-shaped-icon"></span>
                                </div>

                                <a class="site-link"
                                   href="//careers.stackoverflow.com"
                                   data-gps-track="site_switcher.click({ item_type:9 })">
                                    <div class="site-icon favicon favicon-careers" title="Stack Overflow Careers"></div>
                                    Careers 2.0
                                </a>
                            </li>
                        </ul>
                    </div>

                    <div class="header" id="your-communities-header">
                        <h3>
                            your communities
                        </h3>

                    </div>
                    <div class="modal-content" id="your-communities-section">

                        <div class="call-to-login">
                            <a href="https://stackoverflow.com/users/signup?returnurl=http%3a%2f%2fstackoverflow.com%2fquestions%2f111368%2fhow-do-you-performance-test-javascript-code" class="js-gps-track" data-gps-track="site_switcher.click({ item_type:10 })">Sign up</a>
                            or
                            <a href="https://stackoverflow.com/users/login?returnurl=http%3a%2f%2fstackoverflow.com%2fquestions%2f111368%2fhow-do-you-performance-test-javascript-code" class="js-gps-track" data-gps-track="site_switcher.click({ item_type:11 })">log in</a>

                            to customize your list.
                        </div>
                    </div>

                    <div class="header">
                        <h3><a href="//stackexchange.com/sites">more stack exchange communities</a></h3>
                    </div>
                    <div class="modal-content">
                        <div class="child-content"></div>
                    </div>
                </div>
            </div>

            <div class="network-items">

                <a href="//stackexchange.com"
                   class="topbar-icon icon-site-switcher yes-hover js-site-switcher-button js-gps-track"
                   data-gps-track="site_switcher.show"
                   title="A list of all 126 Stack Exchange sites">
                    <span class="hidden-text">Stack Exchange</span>
                </a>

            </div>

            <div class="topbar-links">

                <div class="links-container">
                    <span class="topbar-menu-links">
                        <a href="https://stackoverflow.com/users/signup?returnurl=http%3a%2f%2fstackoverflow.com%2fquestions%2f111368%2fhow-do-you-performance-test-javascript-code" class="login-link">sign up</a>
                        <a href="https://stackoverflow.com/users/login?returnurl=http%3a%2f%2fstackoverflow.com%2fquestions%2f111368%2fhow-do-you-performance-test-javascript-code" class="login-link">log in</a>
                        <a href="/tour">tour</a>

                        <a href="#" class="icon-help js-help-button" title="Help Center and other resources">
                            help
                            <span class="triangle"></span>
                        </a>
                        <div class="topbar-dialog help-dialog js-help-dialog dno">
                            <div class="modal-content">
                                <ul>
                                    <li>
                                        <a href="/tour" class="js-gps-track" data-gps-track="help_popup.click({ item_type:1 })">
                                            Tour
                                            <span class="item-summary">
                                                Start here for a quick overview of the site
                                            </span>
                                        </a>
                                    </li>
                                    <li>
                                        <a href="/help" class="js-gps-track" data-gps-track="help_popup.click({ item_type:4 })">
                                            Help Center
                                            <span class="item-summary">
                                                Detailed answers to any questions you might have
                                            </span>
                                        </a>
                                    </li>
                                    <li>
                                        <a href="//meta.stackoverflow.com" class="js-gps-track" data-gps-track="help_popup.click({ item_type:2 })">
                                            Meta
                                            <span class="item-summary">
                                                Discuss the workings and policies of this site
                                            </span>
                                        </a>
                                    </li>
                                </ul>
                            </div>
                        </div>

                        <a href="//careers.stackoverflow.com">careers 2.0</a>
                    </span>
                </div>

                <div class="search-container">
                    <form id="search" action="/search" method="get" autocomplete="off">
                        <input name="q" type="text" placeholder="search" value="" tabindex="1" autocomplete="off" maxlength="240" />
                    </form>
                </div>

            </div>
        </div>
    </div>

    <div class="container">
        <div id="header" class=headeranon>
            <br class="cbt">
            <div id="hlogo">
                <a href="/">
                    Stack Overflow
                </a>
            </div>
            <div id="hmenus">
                <div class="nav mainnavs mainnavsanon">
                    <ul>
                        <li class="youarehere"><a id="nav-questions" href="/questions">Questions</a></li>
                        <li><a id="nav-tags" href="/tags">Tags</a></li>
                        <li><a id="nav-tour" href="/about">Tour</a></li>
                        <li><a id="nav-users" href="/users">Users</a></li>
                    </ul>
                </div>
                <div class="nav askquestion">
                    <ul>
                        <li>
                            <a id="nav-askquestion" href="/questions/ask">Ask Question</a>
                        </li>
                    </ul>
                </div>
            </div>
        </div>




        <div id="content">


            <div itemscope itemtype="http://schema.org/Article">
                <link itemprop="image" href="//cdn.sstatic.net/stackoverflow/img/apple-touch-icon.png">
                <!--googleoff: all-->

                <div id="herobox-mini">
                    <div id="hero-content">
                        <span id="controls">
                            <a href="/about" id="tell-me-more" class="button">Take the 2-minute tour</a>
                            <span id="close"><a title="click to dismiss">&times;</a></span>
                        </span>
                        <div id="blurb">
                            Stack Overflow is a question and answer site for professional and enthusiast programmers. It&#39;s 100% free, no registration required.
                        </div>
                    </div>
                    
                        $('#tell-me-more').click(function () {
                            var clickSource = $("body").attr("class") + '-mini';
                            if ($("body").hasClass("questions-page")) {
                                clickSource = 'questionpagemini';
                            } else if ($("body").hasClass("question-page")) {
                                clickSource = 'questionpagemini';
                            } else if ($("body").hasClass("home-page")) {
                                clickSource = 'homepagemini';
                            }

                            StackExchange.using("gps", function () {
                                StackExchange.gps.track("aboutpage.click", { aboutclick_location: clickSource }, true);
                            });
                        });
                        $('#herobox-mini #close').click(function () {
                            StackExchange.using("gps", function () {
                                StackExchange.gps.track("hero.action", { hero_action_type: "close" }, true);
                            });
                            $.cookie("hero", "none", { path: "/" });
                            var $hero = $("#herobox-mini");
                            $hero.slideUp('fast', function () { $hero.remove(); });
                            return false;
                        });
                   
                </div>
                <!--googleon: all-->
                <div id="question-header">
                    <h1 itemprop="name"><a href="/questions/111368/how-do-you-performance-test-javascript-code" class="question-hyperlink">How do you performance test JavaScript code?</a></h1>
                </div>
                <div id="mainbar">



                    <div class="question" data-questionid="111368" id="question">

                        <div class="everyonelovesstackoverflow" id="adzerk1743843474">
                        </div>    <table>
                            <tr>
                                <td class="votecell">


                                    <div class="vote">
                                        <input type="hidden" name="_id_" value="111368">
                                        <a class="vote-up-off" title="This question shows research effort; it is useful and clear">up vote</a>
                                        <span class="vote-count-post ">96</span>
                                        <a class="vote-down-off" title="This question does not show any research effort; it is unclear or not useful">down vote</a>

                                        <a class="star-off" href="#" title="This is a favorite question (click again to undo)">favorite</a>
                                        <div class="favoritecount"><b>51</b></div>

                                    </div>

                                </td>

                                <td class="postcell">
                                    <div>
                                        <div class="post-text" itemprop="description">

                                            <p>CPU Cycles, Memory Usage, Execution Time, etc.?</p>

                                            <p>Added: Is there a quantitative way of testing performance in JavaScript besides just perception of how fast the code runs?</p>

                                        </div>
                                        <div class="post-taglist">
                                            <a href="/questions/tagged/javascript" class="post-tag" title="show questions tagged &#39;javascript&#39;" rel="tag">javascript</a> <a href="/questions/tagged/performance" class="post-tag" title="show questions tagged &#39;performance&#39;" rel="tag">performance</a>
                                        </div>
                                        <table class="fw">
                                            <tr>
                                                <td class="vt">
                                                    <div class="post-menu"><a href="/q/111368" title="short permalink to this question" class="short-link" id="link-post-111368">share</a><span class="lsep">|</span><a href="/posts/111368/edit" class="suggest-edit-post" title="">improve this question</a></div>
                                                </td>
                                                <td align="right" class="post-signature">
                                                    <div class="user-info user-hover">
                                                        <div class="user-action-time">
                                                            <a href="/posts/111368/revisions" title="show all edits to this post">edited <span title="2009-12-10 20:03:58Z" class="relativetime">Dec 10 '09 at 20:03</span></a>
                                                        </div>
                                                        <div class="user-gravatar32">
                                                            <a href="/users/63550/peter-mortensen"><div class="gravatar-wrapper-32"><img src="http://i.stack.imgur.com/RIZKi.png?s=32&g=1" alt=""></div></a>
                                                        </div>
                                                        <div class="user-details">
                                                            <a href="/users/63550/peter-mortensen">Peter Mortensen</a><br>
                                                            <span class="reputation-score" title="reputation score " dir="ltr">7,298</span><span title="8 gold badges"><span class="badge1"></span><span class="badgecount">8</span></span><span title="50 silver badges"><span class="badge2"></span><span class="badgecount">50</span></span><span title="82 bronze badges"><span class="badge3"></span><span class="badgecount">82</span></span>
                                                        </div>
                                                    </div>
                                                </td>
                                                <td class="post-signature owner">
                                                    <div class="user-info user-hover">
                                                        <div class="user-action-time">
                                                            asked <span title="2008-09-21 16:35:58Z" class="relativetime">Sep 21 '08 at 16:35</span>
                                                        </div>
                                                        <div class="user-gravatar32">
                                                            <a href="/users/10352/danmine"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/e769130d93ac58cabb6cc4aecbb247de?s=32&d=identicon&r=PG" alt=""></div></a>
                                                        </div>
                                                        <div class="user-details">
                                                            <a href="/users/10352/danmine">danmine</a><br>
                                                            <span class="reputation-score" title="reputation score " dir="ltr">2,794</span><span title="8 gold badges"><span class="badge1"></span><span class="badgecount">8</span></span><span title="32 silver badges"><span class="badge2"></span><span class="badgecount">32</span></span><span title="59 bronze badges"><span class="badge3"></span><span class="badgecount">59</span></span>
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </div>
                                </td>
                            </tr>

                            <tr>
                                <td class="votecell"></td>
                                <td>
                                    <div id="comments-111368" class="comments " data-localized="true">
                                        <table>
                                            <tbody data-remaining-comments-count="0"
                                                   data-addlink-html="add comment"
                                                   data-addlink-disabled="true">

                                                <tr id="comment-17035663" class="comment ">
                                                    <td>
                                                        <table>
                                                            <tbody>
                                                                <tr>
                                                                    <td class=" comment-score">
                                                                        &nbsp;&nbsp;
                                                                    </td>
                                                                    <td>
                                                                        &nbsp;
                                                                    </td>
                                                                </tr>
                                                            </tbody>
                                                        </table>
                                                    </td>
                                                    <td class="comment-text">
                                                        <div style="display: block;" class="comment-body">
                                                            <span class="comment-copy">You might like to look at the <a href="http://developer.yahoo.com/yslow/" rel="nofollow">YSlow</a> plugin for Firefox.</span>
                                                            &ndash;&nbsp;
                                                            <a href="/users/2974/rob-wells"
                                                               title="21472 reputation"
                                                               class="comment-user">Rob Wells</a>
                                                            <span class="comment-date" dir="ltr"><span title="2008-09-21 16:43:31Z" class="relativetime-clean">Sep 21 '08 at 16:43</span></span>
                                                        </div>
                                                    </td>
                                                </tr>
                                                <tr id="comment-17035664" class="comment ">
                                                    <td class="comment-actions">
                                                        <table>
                                                            <tbody>
                                                                <tr>
                                                                    <td class=" comment-score">
                                                                        <span title="number of &#39;useful comment&#39; votes received"
                                                                              class="cool">3</span>
                                                                    </td>
                                                                    <td>
                                                                        &nbsp;
                                                                    </td>
                                                                </tr>
                                                            </tbody>
                                                        </table>
                                                    </td>
                                                    <td class="comment-text">
                                                        <div style="display: block;" class="comment-body">
                                                            <span class="comment-copy">That&#39;s only going to tell you how long it takes to load. I think the question was more concerned with performance when it is running.</span>
                                                            &ndash;&nbsp;
                                                            <a href="/users/2541/sam-hasler"
                                                               title="10155 reputation"
                                                               class="comment-user">Sam Hasler</a>
                                                            <span class="comment-date" dir="ltr"><span title="2008-09-24 01:18:02Z" class="relativetime-clean">Sep 24 '08 at 1:18</span></span>
                                                        </div>
                                                    </td>
                                                </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                    <a id="comments-link-111368" data-rep=50 data-anon=true
                                       class="comments-link disabled-link"
                                       title="Use comments to ask for more information or suggest improvements. Avoid answering questions in comments.">add comment</a>
                                </td>
                            </tr>
                        </table>
                    </div>


                    <div id="answers">

                        <a name="tab-top"></a>
                        <div id="answers-header">
                            <div class="subheader answers-subheader">
                                <h2>
                                    15 Answers
                                </h2>
                                <div>
                                    <div id="tabs">
                                        <a href="/questions/111368/how-do-you-performance-test-javascript-code?answertab=active#tab-top" title="Answers with the latest activity first">active</a>
                                        <a href="/questions/111368/how-do-you-performance-test-javascript-code?answertab=oldest#tab-top" title="Answers in the order they were provided">oldest</a>
                                        <a class="youarehere" href="/questions/111368/how-do-you-performance-test-javascript-code?answertab=votes#tab-top" title="Answers with the highest score first">votes</a>
                                    </div>
                                </div>
                            </div>
                        </div>





                        <a name="111729"></a>
                        <div id="answer-111729" class="answer" data-answerid="111729">
                            <table>
                                <tr>
                                    <td class="votecell">


                                        <div class="vote">
                                            <input type="hidden" name="_id_" value="111729">
                                            <a class="vote-up-off" title="This answer is useful">up vote</a>
                                            <span class="vote-count-post ">98</span>
                                            <a class="vote-down-off" title="This answer is not useful">down vote</a>



                                        </div>

                                    </td>



                                    <td class="answercell">
                                        <div class="post-text">
                                            <p>Profilers are definitely a good way to get numbers, but in my experience, perceived performance is all that matters to the user/client. For example, we had a project with an Ext accordion that expanded to show some data and then a few nested Ext grids.  Everything was actually rendering pretty fast, no single operation took a long time, there was just a lot of information being rendered all at once, so it felt slow to the user.  </p>

                                            <p>We 'fixed' this, not by switching to a faster component, or optimizing some method, but by rendering the data first, then rendering the grids with a setTimeout. So, the information appeared first, then the grids would pop into place a second later. Overall, it took slightly more processing time to do it that way, but to the user, the perceived performance was improved.</p>

                                        </div>
                                        <table class="fw">
                                            <tr>
                                                <td class="vt">
                                                    <div class="post-menu"><a href="/a/111729" title="short permalink to this answer" class="short-link" id="link-post-111729">share</a><span class="lsep">|</span><a href="/posts/111729/edit" class="suggest-edit-post" title="">improve this answer</a></div>
                                                </td>



                                                <td align="right" class="post-signature">


                                                    <div class="user-info user-hover">
                                                        <div class="user-action-time">
                                                            answered <span title="2008-09-21 18:55:21Z" class="relativetime">Sep 21 '08 at 18:55</span>
                                                        </div>
                                                        <div class="user-gravatar32">
                                                            <a href="/users/12034/noah"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/755ad21d2059ac3970754edd621ba65b?s=32&d=identicon&r=PG" alt=""></div></a>
                                                        </div>
                                                        <div class="user-details">
                                                            <a href="/users/12034/noah">noah</a><br>
                                                            <span class="reputation-score" title="reputation score " dir="ltr">9,155</span><span title="4 gold badges"><span class="badge1"></span><span class="badgecount">4</span></span><span title="30 silver badges"><span class="badge2"></span><span class="badgecount">30</span></span><span title="56 bronze badges"><span class="badge3"></span><span class="badgecount">56</span></span>
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>

                                <tr>
                                    <td class="votecell"></td>
                                    <td>
                                        <div id="comments-111729" class="comments " data-localized="true">
                                            <table>
                                                <tbody data-remaining-comments-count="0"
                                                       data-addlink-html="add comment"
                                                       data-addlink-disabled="true">

                                                    <tr id="comment-1784380" class="comment ">
                                                        <td class="comment-actions">
                                                            <table>
                                                                <tbody>
                                                                    <tr>
                                                                        <td class=" comment-score">
                                                                            <span title="number of &#39;useful comment&#39; votes received"
                                                                                  class="warm">12</span>
                                                                        </td>
                                                                        <td>
                                                                            &nbsp;
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </td>
                                                        <td class="comment-text">
                                                            <div style="display: block;" class="comment-body">
                                                                <span class="comment-copy">yes yes yes. I wish I could mod you up 2x ++1</span>
                                                                &ndash;&nbsp;
                                                                <a href="/users/42304/byron-whitlock"
                                                                   title="29453 reputation"
                                                                   class="comment-user">Byron Whitlock</a>
                                                                <span class="comment-date" dir="ltr"><span title="2009-12-10 21:31:40Z" class="relativetime-clean">Dec 10 '09 at 21:31</span></span>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                        <a id="comments-link-111729" data-rep=50 data-anon=true
                                           class="comments-link disabled-link"
                                           title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add comment</a>
                                    </td>
                                </tr>
                            </table>
                        </div>
                     \
                        <div class="everyonelovesstackoverflow" id="adzerk1908824084">
                        </div>

                        <a name="2550811"></a>
                        <div id="answer-2550811" class="answer" data-answerid="2550811">
                            <table>
                                <tr>
                                    <td class="votecell">


                                        <div class="vote">
                                            <input type="hidden" name="_id_" value="2550811">
                                            <a class="vote-up-off" title="This answer is useful">up vote</a>
                                            <span class="vote-count-post ">44</span>
                                            <a class="vote-down-off" title="This answer is not useful">down vote</a>



                                        </div>

                                    </td>



                                    <td class="answercell">
                                        <div class="post-text">
                                            <p>We can always <strong>measure time taken by any function by simple date object</strong>.</p>

<pre><code>var start = +new Date();  // log start timestamp
function1();
var end =  +new Date();  // log end timestamp
var diff = end - start;
</code></pre>

                                        </div>
                                        <table class="fw">
                                            <tr>
                                                <td class="vt">
                                                    <div class="post-menu"><a href="/a/2550811" title="short permalink to this answer" class="short-link" id="link-post-2550811">share</a><span class="lsep">|</span><a href="/posts/2550811/edit" class="suggest-edit-post" title="">improve this answer</a></div>
                                                </td>



                                                <td align="right" class="post-signature">


                                                    <div class="user-info ">
                                                        <div class="user-action-time">
                                                            answered <span title="2010-03-31 06:01:31Z" class="relativetime">Mar 31 '10 at 6:01</span>
                                                        </div>
                                                        <div class="user-gravatar32">
                                                            <a href="/users/40614/pramodc84"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/de60a5fa9b195937c7c94b1804128d1a?s=32&d=identicon&r=PG" alt=""></div></a>
                                                        </div>
                                                        <div class="user-details">
                                                            <a href="/users/40614/pramodc84">pramodc84</a><br>
                                                            <span class="reputation-score" title="reputation score " dir="ltr">788</span><span title="18 silver badges"><span class="badge2"></span><span class="badgecount">18</span></span><span title="26 bronze badges"><span class="badge3"></span><span class="badgecount">26</span></span>
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>

                                <tr>
                                    <td class="votecell"></td>
                                    <td>
                                        <div id="comments-2550811" class="comments " data-localized="true">
                                            <table>
                                                <tbody data-remaining-comments-count="0"
                                                       data-addlink-html="add comment"
                                                       data-addlink-disabled="true">

                                                    <tr id="comment-20540315" class="comment ">
                                                        <td class="comment-actions">
                                                            <table>
                                                                <tbody>
                                                                    <tr>
                                                                        <td class=" comment-score">
                                                                            <span title="number of &#39;useful comment&#39; votes received"
                                                                                  class="warm">6</span>
                                                                        </td>
                                                                        <td>
                                                                            &nbsp;
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </td>
                                                        <td class="comment-text">
                                                            <div style="display: block;" class="comment-body">
                                                                <span class="comment-copy">Note that this solution returns the diff in milliseconds</span>
                                                                &ndash;&nbsp;
                                                                <a href="/users/84292/chris-b"
                                                                   title="3854 reputation"
                                                                   class="comment-user">Chris B</a>
                                                                <span class="comment-date" dir="ltr"><span title="2013-02-04 15:43:58Z" class="relativetime-clean">Feb 4 '13 at 15:43</span></span>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr id="comment-26404685" class="comment ">
                                                        <td class="comment-actions">
                                                            <table>
                                                                <tbody>
                                                                    <tr>
                                                                        <td class=" comment-score">
                                                                            <span title="number of &#39;useful comment&#39; votes received"
                                                                                  class="warm">5</span>
                                                                        </td>
                                                                        <td>
                                                                            &nbsp;
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </td>
                                                        <td class="comment-text">
                                                            <div style="display: block;" class="comment-body">
                                                                <span class="comment-copy">Using Date() is discouraged since the time in milliseconds can vary depending on system factors. Instead use console.time() and console.timeEnd(). See answer by JQuery Lover for more details.</span>
                                                                &ndash;&nbsp;
                                                                <a href="/users/1672318/mbokil"
                                                                   title="486 reputation"
                                                                   class="comment-user">mbokil</a>
                                                                <span class="comment-date" dir="ltr"><span title="2013-08-04 21:22:21Z" class="relativetime-clean">Aug 4 '13 at 21:22</span></span>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr id="comment-36384525" class="comment ">
                                                        <td>
                                                            <table>
                                                                <tbody>
                                                                    <tr>
                                                                        <td class=" comment-score">
                                                                            &nbsp;&nbsp;
                                                                        </td>
                                                                        <td>
                                                                            &nbsp;
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </td>
                                                        <td class="comment-text">
                                                            <div style="display: block;" class="comment-body">
                                                                <span class="comment-copy">Even better, use <a href="https://developer.mozilla.org/en-US/docs/Web/API/Performance.now()" rel="nofollow"><code>performance.now()</code></a></span>
                                                                &ndash;&nbsp;
                                                                <a href="/users/830030/edan"
                                                                   title="386 reputation"
                                                                   class="comment-user">edan</a>
                                                                <span class="comment-date" dir="ltr"><span title="2014-05-15 15:00:32Z" class="relativetime-clean">May 15 at 15:00</span></span>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                        <a id="comments-link-2550811" data-rep=50 data-anon=true
                                           class="comments-link disabled-link"
                                           title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add comment</a>
                                    </td>
                                </tr>
                            </table>
                        </div>


                        <a name="4971482"></a>
                        <div id="answer-4971482" class="answer" data-answerid="4971482">
                            <table>
                                <tr>
                                    <td class="votecell">


                                        <div class="vote">
                                            <input type="hidden" name="_id_" value="4971482">
                                            <a class="vote-up-off" title="This answer is useful">up vote</a>
                                            <span class="vote-count-post ">34</span>
                                            <a class="vote-down-off" title="This answer is not useful">down vote</a>



                                        </div>

                                    </td>



                                    <td class="answercell">
                                        <div class="post-text">
                                            <p>Try <a href="http://jsperf.com">jsPerf</a>. It's an online javascript performance tool for benchmarking and comparing snippets of code. I use it all the time.</p>

                                        </div>
                                        <table class="fw">
                                            <tr>
                                                <td class="vt">
                                                    <div class="post-menu"><a href="/a/4971482" title="short permalink to this answer" class="short-link" id="link-post-4971482">share</a><span class="lsep">|</span><a href="/posts/4971482/edit" class="suggest-edit-post" title="">improve this answer</a></div>
                                                </td>



                                                <td align="right" class="post-signature">


                                                    <div class="user-info ">
                                                        <div class="user-action-time">
                                                            answered <span title="2011-02-11 16:25:43Z" class="relativetime">Feb 11 '11 at 16:25</span>
                                                        </div>
                                                        <div class="user-gravatar32">
                                                            <a href="/users/292955/relax"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/6d5250f50e82bbc8c3daede117b3d031?s=32&d=identicon&r=PG" alt=""></div></a>
                                                        </div>
                                                        <div class="user-details">
                                                            <a href="/users/292955/relax">Relax</a><br>
                                                            <span class="reputation-score" title="reputation score " dir="ltr">563</span><span title="4 silver badges"><span class="badge2"></span><span class="badgecount">4</span></span><span title="7 bronze badges"><span class="badge3"></span><span class="badgecount">7</span></span>
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>

                                <tr>
                                    <td class="votecell"></td>
                                    <td>
                                        <div id="comments-4971482" class="comments " data-localized="true">
                                            <table>
                                                <tbody data-remaining-comments-count="0"
                                                       data-addlink-html="add comment"
                                                       data-addlink-disabled="true">

                                                    <tr id="comment-28804032" class="comment ">
                                                        <td>
                                                            <table>
                                                                <tbody>
                                                                    <tr>
                                                                        <td class=" comment-score">
                                                                            &nbsp;&nbsp;
                                                                        </td>
                                                                        <td>
                                                                            &nbsp;
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </td>
                                                        <td class="comment-text">
                                                            <div style="display: block;" class="comment-body">
                                                                <span class="comment-copy">jsPerf is built upon <a href="https://github.com/bestiejs/benchmark.js" rel="nofollow">github.com/bestiejs/benchmark.js</a></span>
                                                                &ndash;&nbsp;
                                                                <a href="/users/1185957/dannyfritz"
                                                                   title="98 reputation"
                                                                   class="comment-user">dannyfritz</a>
                                                                <span class="comment-date" dir="ltr"><span title="2013-10-17 14:10:57Z" class="relativetime-clean">Oct 17 '13 at 14:10</span></span>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                        <a id="comments-link-4971482" data-rep=50 data-anon=true
                                           class="comments-link disabled-link"
                                           title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add comment</a>
                                    </td>
                                </tr>
                            </table>
                        </div>


                        <a name="4188925"></a>
                        <div id="answer-4188925" class="answer" data-answerid="4188925">
                            <table>
                                <tr>
                                    <td class="votecell">


                                        <div class="vote">
                                            <input type="hidden" name="_id_" value="4188925">
                                            <a class="vote-up-off" title="This answer is useful">up vote</a>
                                            <span class="vote-count-post ">25</span>
                                            <a class="vote-down-off" title="This answer is not useful">down vote</a>



                                        </div>

                                    </td>



                                    <td class="answercell">
                                        <div class="post-text">
                                            <p><a href="http://code.google.com/p/jslitmus/">JSLitmus</a> is a lightweight tool for creating ad-hoc JavaScript benchmark tests</p>

                                            <p>Let examine the performance between <code>function expression</code> and <code>function constructor</code>:</p>

<pre><code>&lt;script src="JSLitmus.js"&gt;&lt;/script&gt;
&lt;script&gt;
JSLitmus.test("new Function ... ", function() { 
    return new Function("for(var i=0; i&lt;100; i++) {}"); 
});
JSLitmus.test("function() ...", function() { 
       return (function() { for(var i=0; i&lt;100; i++) {}  });
});
&lt;/script&gt;
</code></pre>

                                            <p>What I did above is create a <code>function expression</code> and <code>function constructor</code> performing same operation. The result is as follows:</p>

                                            <p><strong>FireFox Performance Result</strong></p>

                                            <p><img src="http://i.stack.imgur.com/Oi4Wl.png" alt="FireFox Performance Result"></p>

                                            <p><strong>IE Performance Result</strong></p>

                                            <p><img src="http://i.stack.imgur.com/7XCCD.png" alt="IE Performance Result"></p>

                                        </div>
                                        <table class="fw">
                                            <tr>
                                                <td class="vt">
                                                    <div class="post-menu"><a href="/a/4188925" title="short permalink to this answer" class="short-link" id="link-post-4188925">share</a><span class="lsep">|</span><a href="/posts/4188925/edit" class="suggest-edit-post" title="">improve this answer</a></div>
                                                </td>
                                                <td align="right" class="post-signature">
                                                    <div class="user-info user-hover">
                                                        <div class="user-action-time">
                                                            <a href="/posts/4188925/revisions" title="show all edits to this post">edited <span title="2012-08-03 03:29:53Z" class="relativetime">Aug 3 '12 at 3:29</span></a>
                                                        </div>
                                                        <div class="user-gravatar32">
                                                            <a href="/users/364198/farray"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/f94ba46f513ebd69717a83890dc8686c?s=32&d=identicon&r=PG" alt=""></div></a>
                                                        </div>
                                                        <div class="user-details">
                                                            <a href="/users/364198/farray">Farray</a><br>
                                                            <span class="reputation-score" title="reputation score " dir="ltr">3,598</span><span title="1 gold badge"><span class="badge1"></span><span class="badgecount">1</span></span><span title="12 silver badges"><span class="badge2"></span><span class="badgecount">12</span></span><span title="24 bronze badges"><span class="badge3"></span><span class="badgecount">24</span></span>
                                                        </div>
                                                    </div>
                                                </td>



                                                <td align="right" class="post-signature">


                                                    <div class="user-info ">
                                                        <div class="user-action-time">
                                                            answered <span title="2010-11-15 21:20:32Z" class="relativetime">Nov 15 '10 at 21:20</span>
                                                        </div>
                                                        <div class="user-gravatar32">
                                                            <a href="/users/134743/ramiz-uddin"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/06a9b12081a0e2c55a44794a489976ce?s=32&d=identicon&r=PG" alt=""></div></a>
                                                        </div>
                                                        <div class="user-details">
                                                            <a href="/users/134743/ramiz-uddin">Ramiz Uddin</a><br>
                                                            <span class="reputation-score" title="reputation score " dir="ltr">2,604</span><span title="4 gold badges"><span class="badge1"></span><span class="badgecount">4</span></span><span title="25 silver badges"><span class="badge2"></span><span class="badgecount">25</span></span><span title="57 bronze badges"><span class="badge3"></span><span class="badgecount">57</span></span>
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>

                                <tr>
                                    <td class="votecell"></td>
                                    <td>
                                        <div id="comments-4188925" class="comments " data-localized="true">
                                            <table>
                                                <tbody data-remaining-comments-count="0"
                                                       data-addlink-html="add comment"
                                                       data-addlink-disabled="true">

                                                    <tr id="comment-15675105" class="comment ">
                                                        <td>
                                                            <table>
                                                                <tbody>
                                                                    <tr>
                                                                        <td class=" comment-score">
                                                                            &nbsp;&nbsp;
                                                                        </td>
                                                                        <td>
                                                                            &nbsp;
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </td>
                                                        <td class="comment-text">
                                                            <div style="display: block;" class="comment-body">
                                                                <span class="comment-copy">The linked JSLitmus page contains broken download links. I&#39;ve found <a href="http://code.google.com/p/pmrpc/source/browse/trunk/benchmark/JSLitmus.js?r=219" rel="nofollow">JSLitmus</a> (for browsers) and <a href="https://github.com/broofa/jslitmus" rel="nofollow">jslitmus</a> (for NodeJS, lowercase!).</span>
                                                                &ndash;&nbsp;
                                                                <a href="/users/938089/rob-w"
                                                                   title="120151 reputation"
                                                                   class="comment-user">Rob W</a>
                                                                <span class="comment-date" dir="ltr"><span title="2012-08-03 14:31:56Z" class="relativetime-clean">Aug 3 '12 at 14:31</span></span>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                        <a id="comments-link-4188925" data-rep=50 data-anon=true
                                           class="comments-link disabled-link"
                                           title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add comment</a>
                                    </td>
                                </tr>
                            </table>
                        </div>


                        <a name="17943511"></a>
                        <div id="answer-17943511" class="answer" data-answerid="17943511">
                            <table>
                                <tr>
                                    <td class="votecell">


                                        <div class="vote">
                                            <input type="hidden" name="_id_" value="17943511">
                                            <a class="vote-up-off" title="This answer is useful">up vote</a>
                                            <span class="vote-count-post ">24</span>
                                            <a class="vote-down-off" title="This answer is not useful">down vote</a>



                                        </div>

                                    </td>



                                    <td class="answercell">
                                        <div class="post-text">
                                            <p>I do agree that perceived performance is really all that matters. But sometimes I just want to find out which method of doing something is faster. Sometimes the difference is HUGE and worth knowing.</p>

                                            <p>You could just use javascript timers. But I typically get much more consistent results using the native Chrome (also in FF) devTool methods <code>console.time()</code> &amp; <code>console.timeEnd()</code></p>

                                            <p>Example of how I use it:</p>

<pre><code>var iterations = 1000000;
console.time('Function #1');
for(var i = 0; i &lt; iterations; i++ ){
    functionOne();
};
console.timeEnd('Function #1')
console.time('Function #2');
for(var i = 0; i &lt; iterations; i++ ){
    functionTwo();
};
console.timeEnd('Function #2')
</code></pre>

                                            <p><img src="http://i.stack.imgur.com/IVo6d.png" alt="Results Look like this"></p>

                                        </div>
                                        <table class="fw">
                                            <tr>
                                                <td class="vt">
                                                    <div class="post-menu"><a href="/a/17943511" title="short permalink to this answer" class="short-link" id="link-post-17943511">share</a><span class="lsep">|</span><a href="/posts/17943511/edit" class="suggest-edit-post" title="">improve this answer</a></div>
                                                </td>



                                                <td align="right" class="post-signature">


                                                    <div class="user-info ">
                                                        <div class="user-action-time">
                                                            answered <span title="2013-07-30 09:41:33Z" class="relativetime">Jul 30 '13 at 9:41</span>
                                                        </div>
                                                        <div class="user-gravatar32">
                                                            <a href="/users/831738/jose-browne"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/529fcc5c60a48b97002ec21bd6f668e6?s=32&d=identicon&r=PG" alt=""></div></a>
                                                        </div>
                                                        <div class="user-details">
                                                            <a href="/users/831738/jose-browne">Jose Browne</a><br>
                                                            <span class="reputation-score" title="reputation score " dir="ltr">968</span><span title="7 silver badges"><span class="badge2"></span><span class="badgecount">7</span></span><span title="16 bronze badges"><span class="badge3"></span><span class="badgecount">16</span></span>
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>

                                <tr>
                                    <td class="votecell"></td>
                                    <td>
                                        <div id="comments-17943511" class="comments " data-localized="true">
                                            <table>
                                                <tbody data-remaining-comments-count="0"
                                                       data-addlink-html="add comment"
                                                       data-addlink-disabled="true">

                                                    <tr id="comment-32735527" class="comment ">
                                                        <td>
                                                            <table>
                                                                <tbody>
                                                                    <tr>
                                                                        <td class=" comment-score">
                                                                            &nbsp;&nbsp;
                                                                        </td>
                                                                        <td>
                                                                            &nbsp;
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </td>
                                                        <td class="comment-text">
                                                            <div style="display: block;" class="comment-body">
                                                                <span class="comment-copy">Yes, one of the charms with this one is that it&#39;s fast n easy to implement. I wonder, will the logging per se take some of the performance from the javascript execution. Let&#39;s say that we have a loop in a game and it outputs multiple log rows. For example once per second for 5 minutes, that is 300 rows. Anyone knows?</span>
                                                                &ndash;&nbsp;
                                                                <a href="/users/1781318/kilian-lindberg"
                                                                   title="409 reputation"
                                                                   class="comment-user">Kilian Lindberg</a>
                                                                <span class="comment-date" dir="ltr"><span title="2014-02-09 11:37:20Z" class="relativetime-clean">Feb 9 at 11:37</span></span>
                                                                <span class="edited-yes" title="this comment was edited 1 time"></span>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                        <a id="comments-link-17943511" data-rep=50 data-anon=true
                                           class="comments-link disabled-link"
                                           title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add comment</a>
                                    </td>
                                </tr>
                            </table>
                        </div>


                        <a name="111397"></a>
                        <div id="answer-111397" class="answer" data-answerid="111397">
                            <table>
                                <tr>
                                    <td class="votecell">


                                        <div class="vote">
                                            <input type="hidden" name="_id_" value="111397">
                                            <a class="vote-up-off" title="This answer is useful">up vote</a>
                                            <span class="vote-count-post ">13</span>
                                            <a class="vote-down-off" title="This answer is not useful">down vote</a>



                                        </div>

                                    </td>



                                    <td class="answercell">
                                        <div class="post-text">
                                            <p>Some people are suggesting specific plug-ins and/or browsers. I would not because they're only <em>really</em> useful for that one platform; a test run on Firefox will not translate accurately to IE7. Considering 99.999999% of sites have more than one browser visit them, <strong>you need to check performance on all the popular platforms.</strong></p>

                                            <p>My suggestion would be to keep this in the JS. Create a benchmarking page with all your JS test on and time the execution. You could even have it AJAX-post the results back to you to keep it fully automated.</p>

                                            <p>Then just rinse and repeat over different platforms.</p>

                                        </div>
                                        <table class="fw">
                                            <tr>
                                                <td class="vt">
                                                    <div class="post-menu"><a href="/a/111397" title="short permalink to this answer" class="short-link" id="link-post-111397">share</a><span class="lsep">|</span><a href="/posts/111397/edit" class="suggest-edit-post" title="">improve this answer</a></div>
                                                </td>
                                                <td align="right" class="post-signature">
                                                    <div class="user-info ">
                                                        <div class="user-action-time">
                                                            <a href="/posts/111397/revisions" title="show all edits to this post">edited <span title="2008-09-21 16:57:00Z" class="relativetime">Sep 21 '08 at 16:57</span></a>
                                                        </div>
                                                        <div class="user-gravatar32">

                                                        </div>
                                                        <div class="user-details">
                                                            <br>

                                                        </div>
                                                    </div>
                                                </td>



                                                <td align="right" class="post-signature">


                                                    <div class="user-info user-hover">
                                                        <div class="user-action-time">
                                                            answered <span title="2008-09-21 16:50:03Z" class="relativetime">Sep 21 '08 at 16:50</span>
                                                        </div>
                                                        <div class="user-gravatar32">
                                                            <a href="/users/12870/oli"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/f0af40756420859b5b63cbceb6d30505?s=32&d=identicon&r=PG" alt=""></div></a>
                                                        </div>
                                                        <div class="user-details">
                                                            <a href="/users/12870/oli">Oli</a><br>
                                                            <span class="reputation-score" title="reputation score 63134" dir="ltr">63.1k</span><span title="24 gold badges"><span class="badge1"></span><span class="badgecount">24</span></span><span title="129 silver badges"><span class="badge2"></span><span class="badgecount">129</span></span><span title="185 bronze badges"><span class="badge3"></span><span class="badgecount">185</span></span>
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>

                                <tr>
                                    <td class="votecell"></td>
                                    <td>
                                        <div id="comments-111397" class="comments " data-localized="true">
                                            <table>
                                                <tbody data-remaining-comments-count="0"
                                                       data-addlink-html="add comment"
                                                       data-addlink-disabled="true">

                                                    <tr id="comment-21852" class="comment ">
                                                        <td class="comment-actions">
                                                            <table>
                                                                <tbody>
                                                                    <tr>
                                                                        <td class=" comment-score">
                                                                            <span title="number of &#39;useful comment&#39; votes received"
                                                                                  class="cool">2</span>
                                                                        </td>
                                                                        <td>
                                                                            &nbsp;
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </td>
                                                        <td class="comment-text">
                                                            <div style="display: block;" class="comment-body">
                                                                <span class="comment-copy">this is true, but profilers are good in case there is a coding problem that has nothing to do with a browser specific issue.</span>
                                                                &ndash;&nbsp;
                                                                <a href="/users/2847/john-boker"
                                                                   title="35521 reputation"
                                                                   class="comment-user">John Boker</a>
                                                                <span class="comment-date" dir="ltr"><span title="2008-09-21 17:02:48Z" class="relativetime-clean">Sep 21 '08 at 17:02</span></span>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr id="comment-21993" class="comment ">
                                                        <td>
                                                            <table>
                                                                <tbody>
                                                                    <tr>
                                                                        <td class=" comment-score">
                                                                            &nbsp;&nbsp;
                                                                        </td>
                                                                        <td>
                                                                            &nbsp;
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </td>
                                                        <td class="comment-text">
                                                            <div style="display: block;" class="comment-body">
                                                                <span class="comment-copy">Sure! Yeah they&#39;ll catch general &quot;bad coding&quot; problems and specific ones are great for doing the actual debugging, but for general use-case testing, you&#39;ll benefit from something that runs on all platforms.</span>
                                                                &ndash;&nbsp;
                                                                <a href="/users/12870/oli"
                                                                   title="63134 reputation"
                                                                   class="comment-user">Oli</a>
                                                                <span class="comment-date" dir="ltr"><span title="2008-09-21 19:02:29Z" class="relativetime-clean">Sep 21 '08 at 19:02</span></span>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr id="comment-1784319" class="comment ">
                                                        <td class="comment-actions">
                                                            <table>
                                                                <tbody>
                                                                    <tr>
                                                                        <td class=" comment-score">
                                                                            <span title="number of &#39;useful comment&#39; votes received"
                                                                                  class="cool">1</span>
                                                                        </td>
                                                                        <td>
                                                                            &nbsp;
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </td>
                                                        <td class="comment-text">
                                                            <div style="display: block;" class="comment-body">
                                                                <span class="comment-copy">+1 on the note that this is true, but having a profiler like Firebug is still great, if not essential, to find bottlenecks.</span>
                                                                &ndash;&nbsp;
                                                                <a href="/users/187606/pekka"
                                                                   title="245710 reputation"
                                                                   class="comment-user">Pekka 웃</a>
                                                                <span class="comment-date" dir="ltr"><span title="2009-12-10 21:23:54Z" class="relativetime-clean">Dec 10 '09 at 21:23</span></span>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                        <a id="comments-link-111397" data-rep=50 data-anon=true
                                           class="comments-link disabled-link"
                                           title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add comment</a>
                                    </td>
                                </tr>
                            </table>
                        </div>


                        <a name="111396"></a>
                        <div id="answer-111396" class="answer" data-answerid="111396">
                            <table>
                                <tr>
                                    <td class="votecell">


                                        <div class="vote">
                                            <input type="hidden" name="_id_" value="111396">
                                            <a class="vote-up-off" title="This answer is useful">up vote</a>
                                            <span class="vote-count-post ">5</span>
                                            <a class="vote-down-off" title="This answer is not useful">down vote</a>



                                        </div>

                                    </td>



                                    <td class="answercell">
                                        <div class="post-text">
                                            <p>You could use this: <a href="http://getfirebug.com/js.html" rel="nofollow">http://getfirebug.com/js.html</a>. It has a profiler for JavaScript.</p>

                                        </div>
                                        <table class="fw">
                                            <tr>
                                                <td class="vt">
                                                    <div class="post-menu"><a href="/a/111396" title="short permalink to this answer" class="short-link" id="link-post-111396">share</a><span class="lsep">|</span><a href="/posts/111396/edit" class="suggest-edit-post" title="">improve this answer</a></div>
                                                </td>
                                                <td align="right" class="post-signature">
                                                    <div class="user-info user-hover">
                                                        <div class="user-action-time">
                                                            <a href="/posts/111396/revisions" title="show all edits to this post">edited <span title="2009-12-10 21:22:50Z" class="relativetime">Dec 10 '09 at 21:22</span></a>
                                                        </div>
                                                        <div class="user-gravatar32">
                                                            <a href="/users/63550/peter-mortensen"><div class="gravatar-wrapper-32"><img src="http://i.stack.imgur.com/RIZKi.png?s=32&g=1" alt=""></div></a>
                                                        </div>
                                                        <div class="user-details">
                                                            <a href="/users/63550/peter-mortensen">Peter Mortensen</a><br>
                                                            <span class="reputation-score" title="reputation score " dir="ltr">7,298</span><span title="8 gold badges"><span class="badge1"></span><span class="badgecount">8</span></span><span title="50 silver badges"><span class="badge2"></span><span class="badgecount">50</span></span><span title="82 bronze badges"><span class="badge3"></span><span class="badgecount">82</span></span>
                                                        </div>
                                                    </div>
                                                </td>



                                                <td align="right" class="post-signature">


                                                    <div class="user-info user-hover">
                                                        <div class="user-action-time">
                                                            answered <span title="2008-09-21 16:48:56Z" class="relativetime">Sep 21 '08 at 16:48</span>
                                                        </div>
                                                        <div class="user-gravatar32">
                                                            <a href="/users/2847/john-boker"><div class="gravatar-wrapper-32"><img src="http://i.stack.imgur.com/zNdvw.jpg?s=32&g=1" alt=""></div></a>
                                                        </div>
                                                        <div class="user-details">
                                                            <a href="/users/2847/john-boker">John Boker</a><br>
                                                            <span class="reputation-score" title="reputation score 35521" dir="ltr">35.5k</span><span title="10 gold badges"><span class="badge1"></span><span class="badgecount">10</span></span><span title="50 silver badges"><span class="badge2"></span><span class="badgecount">50</span></span><span title="92 bronze badges"><span class="badge3"></span><span class="badgecount">92</span></span>
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>

                                <tr>
                                    <td class="votecell"></td>
                                    <td>
                                        <div id="comments-111396" class="comments  dno" data-localized="true">
                                            <table>
                                                <tbody data-remaining-comments-count="0"
                                                       data-addlink-html="add comment"
                                                       data-addlink-disabled="true">
                                                    <tr><td></td><td></td></tr>
                                                </tbody>
                                            </table>
                                        </div>
                                        <a id="comments-link-111396" data-rep=50 data-anon=true
                                           class="comments-link disabled-link"
                                           title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add comment</a>
                                    </td>
                                </tr>
                            </table>
                        </div>


                        <a name="10669341"></a>
                        <div id="answer-10669341" class="answer" data-answerid="10669341">
                            <table>
                                <tr>
                                    <td class="votecell">


                                        <div class="vote">
                                            <input type="hidden" name="_id_" value="10669341">
                                            <a class="vote-up-off" title="This answer is useful">up vote</a>
                                            <span class="vote-count-post ">5</span>
                                            <a class="vote-down-off" title="This answer is not useful">down vote</a>



                                        </div>

                                    </td>



                                    <td class="answercell">
                                        <div class="post-text">
                                            <p>Here is a simple function that displays the execution time of a passed in function.</p>

<pre><code>var perf = function (testName, fn) {
  var startTime = new Date().getTime();
  fn();
  var endTime = new Date().getTime();
  console.log(testName + ": " + (endTime - startTime) + "ms");
}
</code></pre>

                                        </div>
                                        <table class="fw">
                                            <tr>
                                                <td class="vt">
                                                    <div class="post-menu"><a href="/a/10669341" title="short permalink to this answer" class="short-link" id="link-post-10669341">share</a><span class="lsep">|</span><a href="/posts/10669341/edit" class="suggest-edit-post" title="">improve this answer</a></div>
                                                </td>



                                                <td align="right" class="post-signature">


                                                    <div class="user-info ">
                                                        <div class="user-action-time">
                                                            answered <span title="2012-05-19 22:38:24Z" class="relativetime">May 19 '12 at 22:38</span>
                                                        </div>
                                                        <div class="user-gravatar32">
                                                            <a href="/users/221435/bunz"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/d1c6269dbbbf06822b6ff9f755635659?s=32&d=identicon&r=PG" alt=""></div></a>
                                                        </div>
                                                        <div class="user-details">
                                                            <a href="/users/221435/bunz">Bunz</a><br>
                                                            <span class="reputation-score" title="reputation score " dir="ltr">138</span><span title="1 silver badge"><span class="badge2"></span><span class="badgecount">1</span></span><span title="5 bronze badges"><span class="badge3"></span><span class="badgecount">5</span></span>
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>

                                <tr>
                                    <td class="votecell"></td>
                                    <td>
                                        <div id="comments-10669341" class="comments  dno" data-localized="true">
                                            <table>
                                                <tbody data-remaining-comments-count="0"
                                                       data-addlink-html="add comment"
                                                       data-addlink-disabled="true">
                                                    <tr><td></td><td></td></tr>
                                                </tbody>
                                            </table>
                                        </div>
                                        <a id="comments-link-10669341" data-rep=50 data-anon=true
                                           class="comments-link disabled-link"
                                           title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add comment</a>
                                    </td>
                                </tr>
                            </table>
                        </div>


                        <a name="393724"></a>
                        <div id="answer-393724" class="answer" data-answerid="393724">
                            <table>
                                <tr>
                                    <td class="votecell">


                                        <div class="vote">
                                            <input type="hidden" name="_id_" value="393724">
                                            <a class="vote-up-off" title="This answer is useful">up vote</a>
                                            <span class="vote-count-post ">3</span>
                                            <a class="vote-down-off" title="This answer is not useful">down vote</a>



                                        </div>

                                    </td>



                                    <td class="answercell">
                                        <div class="post-text">
                                            <p>I think JavaScript performance (time) testing is quite enough. I found a very handy article about <a href="http://jquery-howto.blogspot.com/2008/12/how-to-test-javascript-performance.html" rel="nofollow">JavaScript performance testing here</a>.</p>

                                        </div>
                                        <table class="fw">
                                            <tr>
                                                <td class="vt">
                                                    <div class="post-menu"><a href="/a/393724" title="short permalink to this answer" class="short-link" id="link-post-393724">share</a><span class="lsep">|</span><a href="/posts/393724/edit" class="suggest-edit-post" title="">improve this answer</a></div>
                                                </td>
                                                <td align="right" class="post-signature">
                                                    <div class="user-info user-hover">
                                                        <div class="user-action-time">
                                                            <a href="/posts/393724/revisions" title="show all edits to this post">edited <span title="2009-12-10 21:21:54Z" class="relativetime">Dec 10 '09 at 21:21</span></a>
                                                        </div>
                                                        <div class="user-gravatar32">
                                                            <a href="/users/63550/peter-mortensen"><div class="gravatar-wrapper-32"><img src="http://i.stack.imgur.com/RIZKi.png?s=32&g=1" alt=""></div></a>
                                                        </div>
                                                        <div class="user-details">
                                                            <a href="/users/63550/peter-mortensen">Peter Mortensen</a><br>
                                                            <span class="reputation-score" title="reputation score " dir="ltr">7,298</span><span title="8 gold badges"><span class="badge1"></span><span class="badgecount">8</span></span><span title="50 silver badges"><span class="badge2"></span><span class="badgecount">50</span></span><span title="82 bronze badges"><span class="badge3"></span><span class="badgecount">82</span></span>
                                                        </div>
                                                    </div>
                                                </td>



                                                <td align="right" class="post-signature">


                                                    <div class="user-info ">
                                                        <div class="user-action-time">
                                                            answered <span title="2008-12-26 12:32:39Z" class="relativetime">Dec 26 '08 at 12:32</span>
                                                        </div>
                                                        <div class="user-gravatar32">
                                                            <a href="/users/49200/jquery-lover"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/2d974c6f04064429b8368336a5f41c82?s=32&d=identicon&r=PG" alt=""></div></a>
                                                        </div>
                                                        <div class="user-details">
                                                            <a href="/users/49200/jquery-lover">jQuery Lover</a><br>
                                                            <span class="reputation-score" title="reputation score " dir="ltr">427</span><span title="1 gold badge"><span class="badge1"></span><span class="badgecount">1</span></span><span title="4 silver badges"><span class="badge2"></span><span class="badgecount">4</span></span><span title="6 bronze badges"><span class="badge3"></span><span class="badgecount">6</span></span>
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>

                                <tr>
                                    <td class="votecell"></td>
                                    <td>
                                        <div id="comments-393724" class="comments  dno" data-localized="true">
                                            <table>
                                                <tbody data-remaining-comments-count="0"
                                                       data-addlink-html="add comment"
                                                       data-addlink-disabled="true">
                                                    <tr><td></td><td></td></tr>
                                                </tbody>
                                            </table>
                                        </div>
                                        <a id="comments-link-393724" data-rep=50 data-anon=true
                                           class="comments-link disabled-link"
                                           title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add comment</a>
                                    </td>
                                </tr>
                            </table>
                        </div>


                        <a name="111376"></a>
                        <div id="answer-111376" class="answer" data-answerid="111376">
                            <table>
                                <tr>
                                    <td class="votecell">


                                        <div class="vote">
                                            <input type="hidden" name="_id_" value="111376">
                                            <a class="vote-up-off" title="This answer is useful">up vote</a>
                                            <span class="vote-count-post ">2</span>
                                            <a class="vote-down-off" title="This answer is not useful">down vote</a>



                                        </div>

                                    </td>



                                    <td class="answercell">
                                        <div class="post-text">
                                            <p>I find execution time to be the best measure.</p>

                                        </div>
                                        <table class="fw">
                                            <tr>
                                                <td class="vt">
                                                    <div class="post-menu"><a href="/a/111376" title="short permalink to this answer" class="short-link" id="link-post-111376">share</a><span class="lsep">|</span><a href="/posts/111376/edit" class="suggest-edit-post" title="">improve this answer</a></div>
                                                </td>



                                                <td align="right" class="post-signature">


                                                    <div class="user-info user-hover">
                                                        <div class="user-action-time">
                                                            answered <span title="2008-09-21 16:38:50Z" class="relativetime">Sep 21 '08 at 16:38</span>
                                                        </div>
                                                        <div class="user-gravatar32">
                                                            <a href="/users/7819/pdavis"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/377c8bbea07695b8ac813040a3bfb357?s=32&d=identicon&r=PG" alt=""></div></a>
                                                        </div>
                                                        <div class="user-details">
                                                            <a href="/users/7819/pdavis">pdavis</a><br>
                                                            <span class="reputation-score" title="reputation score " dir="ltr">2,494</span><span title="1 gold badge"><span class="badge1"></span><span class="badgecount">1</span></span><span title="16 silver badges"><span class="badge2"></span><span class="badgecount">16</span></span><span title="25 bronze badges"><span class="badge3"></span><span class="badgecount">25</span></span>
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>

                                <tr>
                                    <td class="votecell"></td>
                                    <td>
                                        <div id="comments-111376" class="comments " data-localized="true">
                                            <table>
                                                <tbody data-remaining-comments-count="0"
                                                       data-addlink-html="add comment"
                                                       data-addlink-disabled="true">

                                                    <tr id="comment-1784323" class="comment ">
                                                        <td>
                                                            <table>
                                                                <tbody>
                                                                    <tr>
                                                                        <td class=" comment-score">
                                                                            &nbsp;&nbsp;
                                                                        </td>
                                                                        <td>
                                                                            &nbsp;
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </td>
                                                        <td class="comment-text">
                                                            <div style="display: block;" class="comment-body">
                                                                <span class="comment-copy">As opposed to what? I&#39;m not sure I understand.</span>
                                                                &ndash;&nbsp;
                                                                <a href="/users/187606/pekka"
                                                                   title="245710 reputation"
                                                                   class="comment-user">Pekka 웃</a>
                                                                <span class="comment-date" dir="ltr"><span title="2009-12-10 21:24:27Z" class="relativetime-clean">Dec 10 '09 at 21:24</span></span>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr id="comment-1784369" class="comment ">
                                                        <td>
                                                            <table>
                                                                <tbody>
                                                                    <tr>
                                                                        <td class=" comment-score">
                                                                            &nbsp;&nbsp;
                                                                        </td>
                                                                        <td>
                                                                            &nbsp;
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </td>
                                                        <td class="comment-text">
                                                            <div style="display: block;" class="comment-body">
                                                                <span class="comment-copy">As opposed to the orignal posters question: &quot;CPU Cycles, Memory Usage, Execution Time, etc.?&quot;</span>
                                                                &ndash;&nbsp;
                                                                <a href="/users/160359/snicker"
                                                                   title="3043 reputation"
                                                                   class="comment-user">snicker</a>
                                                                <span class="comment-date" dir="ltr"><span title="2009-12-10 21:30:37Z" class="relativetime-clean">Dec 10 '09 at 21:30</span></span>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                        <a id="comments-link-111376" data-rep=50 data-anon=true
                                           class="comments-link disabled-link"
                                           title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add comment</a>
                                    </td>
                                </tr>
                            </table>
                        </div>


                        <a name="12262477"></a>
                        <div id="answer-12262477" class="answer" data-answerid="12262477">
                            <table>
                                <tr>
                                    <td class="votecell">


                                        <div class="vote">
                                            <input type="hidden" name="_id_" value="12262477">
                                            <a class="vote-up-off" title="This answer is useful">up vote</a>
                                            <span class="vote-count-post ">2</span>
                                            <a class="vote-down-off" title="This answer is not useful">down vote</a>



                                        </div>

                                    </td>



                                    <td class="answercell">
                                        <div class="post-text">
                                            <p>You could use <a href="http://getfirebug.com/logging" rel="nofollow">console.profile</a> in firebug</p>

                                        </div>
                                        <table class="fw">
                                            <tr>
                                                <td class="vt">
                                                    <div class="post-menu"><a href="/a/12262477" title="short permalink to this answer" class="short-link" id="link-post-12262477">share</a><span class="lsep">|</span><a href="/posts/12262477/edit" class="suggest-edit-post" title="">improve this answer</a></div>
                                                </td>



                                                <td align="right" class="post-signature">


                                                    <div class="user-info ">
                                                        <div class="user-action-time">
                                                            answered <span title="2012-09-04 11:21:57Z" class="relativetime">Sep 4 '12 at 11:21</span>
                                                        </div>
                                                        <div class="user-gravatar32">
                                                            <a href="/users/1474739/willem-de-wit"><div class="gravatar-wrapper-32"><img src="http://i.stack.imgur.com/LUkEQ.jpg?s=32&g=1" alt=""></div></a>
                                                        </div>
                                                        <div class="user-details">
                                                            <a href="/users/1474739/willem-de-wit">Willem de Wit</a><br>
                                                            <span class="reputation-score" title="reputation score " dir="ltr">2,344</span><span title="14 silver badges"><span class="badge2"></span><span class="badgecount">14</span></span><span title="41 bronze badges"><span class="badge3"></span><span class="badgecount">41</span></span>
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>

                                <tr>
                                    <td class="votecell"></td>
                                    <td>
                                        <div id="comments-12262477" class="comments  dno" data-localized="true">
                                            <table>
                                                <tbody data-remaining-comments-count="0"
                                                       data-addlink-html="add comment"
                                                       data-addlink-disabled="true">
                                                    <tr><td></td><td></td></tr>
                                                </tbody>
                                            </table>
                                        </div>
                                        <a id="comments-link-12262477" data-rep=50 data-anon=true
                                           class="comments-link disabled-link"
                                           title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add comment</a>
                                    </td>
                                </tr>
                            </table>
                        </div>


                        <a name="111373"></a>
                        <div id="answer-111373" class="answer" data-answerid="111373">
                            <table>
                                <tr>
                                    <td class="votecell">


                                        <div class="vote">
                                            <input type="hidden" name="_id_" value="111373">
                                            <a class="vote-up-off" title="This answer is useful">up vote</a>
                                            <span class="vote-count-post ">1</span>
                                            <a class="vote-down-off" title="This answer is not useful">down vote</a>



                                        </div>

                                    </td>



                                    <td class="answercell">
                                        <div class="post-text">
                                            <p>Chrome has some good tools built in for this.</p>

                                        </div>
                                        <table class="fw">
                                            <tr>
                                                <td class="vt">
                                                    <div class="post-menu"><a href="/a/111373" title="short permalink to this answer" class="short-link" id="link-post-111373">share</a><span class="lsep">|</span><a href="/posts/111373/edit" class="suggest-edit-post" title="">improve this answer</a></div>
                                                </td>



                                                <td align="right" class="post-signature">


                                                    <div class="user-info user-hover">
                                                        <div class="user-action-time">
                                                            answered <span title="2008-09-21 16:38:17Z" class="relativetime">Sep 21 '08 at 16:38</span>
                                                        </div>
                                                        <div class="user-gravatar32">
                                                            <a href="/users/10906/kevin-conner"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/00ae73d6f56fdd1670b86f5267b92eaa?s=32&d=identicon&r=PG" alt=""></div></a>
                                                        </div>
                                                        <div class="user-details">
                                                            <a href="/users/10906/kevin-conner">Kevin Conner</a><br>
                                                            <span class="reputation-score" title="reputation score " dir="ltr">5,732</span><span title="1 gold badge"><span class="badge1"></span><span class="badgecount">1</span></span><span title="26 silver badges"><span class="badge2"></span><span class="badgecount">26</span></span><span title="41 bronze badges"><span class="badge3"></span><span class="badgecount">41</span></span>
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>

                                <tr>
                                    <td class="votecell"></td>
                                    <td>
                                        <div id="comments-111373" class="comments " data-localized="true">
                                            <table>
                                                <tbody data-remaining-comments-count="0"
                                                       data-addlink-html="add comment"
                                                       data-addlink-disabled="true">

                                                    <tr id="comment-27770751" class="comment ">
                                                        <td>
                                                            <table>
                                                                <tbody>
                                                                    <tr>
                                                                        <td class=" comment-score">
                                                                            &nbsp;&nbsp;
                                                                        </td>
                                                                        <td>
                                                                            &nbsp;
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </td>
                                                        <td class="comment-text">
                                                            <div style="display: block;" class="comment-body">
                                                                <span class="comment-copy">How to access them?</span>
                                                                &ndash;&nbsp;
                                                                <a href="/users/2072569/dalvik-vm"
                                                                   title="86 reputation"
                                                                   class="comment-user">Dalvik VM</a>
                                                                <span class="comment-date" dir="ltr"><span title="2013-09-16 11:25:29Z" class="relativetime-clean">Sep 16 '13 at 11:25</span></span>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr id="comment-31720408" class="comment ">
                                                        <td>
                                                            <table>
                                                                <tbody>
                                                                    <tr>
                                                                        <td class=" comment-score">
                                                                            &nbsp;&nbsp;
                                                                        </td>
                                                                        <td>
                                                                            &nbsp;
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </td>
                                                        <td class="comment-text">
                                                            <div style="display: block;" class="comment-body">
                                                                <span class="comment-copy">Simple, press f12. Go to network tab. Press f5 to refresh your web page and see the magic.</span>
                                                                &ndash;&nbsp;
                                                                <a href="/users/942301/theinsaneone"
                                                                   title="394 reputation"
                                                                   class="comment-user">theinsaneone</a>
                                                                <span class="comment-date" dir="ltr"><span title="2014-01-13 10:11:05Z" class="relativetime-clean">Jan 13 at 10:11</span></span>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                        <a id="comments-link-111373" data-rep=50 data-anon=true
                                           class="comments-link disabled-link"
                                           title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add comment</a>
                                    </td>
                                </tr>
                            </table>
                        </div>


                        <a name="886493"></a>
                        <div id="answer-886493" class="answer" data-answerid="886493">
                            <table>
                                <tr>
                                    <td class="votecell">


                                        <div class="vote">
                                            <input type="hidden" name="_id_" value="886493">
                                            <a class="vote-up-off" title="This answer is useful">up vote</a>
                                            <span class="vote-count-post ">1</span>
                                            <a class="vote-down-off" title="This answer is not useful">down vote</a>



                                        </div>

                                    </td>



                                    <td class="answercell">
                                        <div class="post-text">
                                            <p>I usually just test javascript performance, how long script runs. jQuery Lover gave a good article link for testing <a href="http://jquery-howto.blogspot.com/2008/12/how-to-test-javascript-performance.html" rel="nofollow"><strong>javascript code performance</strong></a>, but the article only shows how to test how long your javascript code runs. I would also recommend reading article called "5 tips on <a href="http://jquery-howto.blogspot.com/2009/02/5-easy-tips-on-how-to-improve-code.html" rel="nofollow">improving your jQuery code</a> while working with huge data sets".</p>

                                        </div>
                                        <table class="fw">
                                            <tr>
                                                <td class="vt">
                                                    <div class="post-menu"><a href="/a/886493" title="short permalink to this answer" class="short-link" id="link-post-886493">share</a><span class="lsep">|</span><a href="/posts/886493/edit" class="suggest-edit-post" title="">improve this answer</a></div>
                                                </td>



                                                <td align="right" class="post-signature">


                                                    <div class="user-info ">
                                                        <div class="user-action-time">
                                                            answered <span title="2009-05-20 06:54:27Z" class="relativetime">May 20 '09 at 6:54</span>
                                                        </div>
                                                        <div class="user-gravatar32">
                                                            <a href="/users/52317/uzbekjon"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/b3da0ca2685a59740d157b22aec70935?s=32&d=identicon&r=PG" alt=""></div></a>
                                                        </div>
                                                        <div class="user-details">
                                                            <a href="/users/52317/uzbekjon">Uzbekjon</a><br>
                                                            <span class="reputation-score" title="reputation score " dir="ltr">804</span><span title="9 silver badges"><span class="badge2"></span><span class="badgecount">9</span></span><span title="13 bronze badges"><span class="badge3"></span><span class="badgecount">13</span></span>
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>

                                <tr>
                                    <td class="votecell"></td>
                                    <td>
                                        <div id="comments-886493" class="comments  dno" data-localized="true">
                                            <table>
                                                <tbody data-remaining-comments-count="0"
                                                       data-addlink-html="add comment"
                                                       data-addlink-disabled="true">
                                                    <tr><td></td><td></td></tr>
                                                </tbody>
                                            </table>
                                        </div>
                                        <a id="comments-link-886493" data-rep=50 data-anon=true
                                           class="comments-link disabled-link"
                                           title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add comment</a>
                                    </td>
                                </tr>
                            </table>
                        </div>


                        <a name="111374"></a>
                        <div id="answer-111374" class="answer" data-answerid="111374">
                            <table>
                                <tr>
                                    <td class="votecell">


                                        <div class="vote">
                                            <input type="hidden" name="_id_" value="111374">
                                            <a class="vote-up-off" title="This answer is useful">up vote</a>
                                            <span class="vote-count-post ">0</span>
                                            <a class="vote-down-off" title="This answer is not useful">down vote</a>



                                        </div>

                                    </td>



                                    <td class="answercell">
                                        <div class="post-text">
                                            <p>The golden rule is to NOT under ANY circumstances lock your users browser. After that, I usually look at execution time, followed by memory usage (unless you're doing something crazy, in which case it could be a higher priority).</p>

                                        </div>
                                        <table class="fw">
                                            <tr>
                                                <td class="vt">
                                                    <div class="post-menu"><a href="/a/111374" title="short permalink to this answer" class="short-link" id="link-post-111374">share</a><span class="lsep">|</span><a href="/posts/111374/edit" class="suggest-edit-post" title="">improve this answer</a></div>
                                                </td>



                                                <td align="right" class="post-signature">


                                                    <div class="user-info ">
                                                        <div class="user-action-time">
                                                            answered <span title="2008-09-21 16:38:36Z" class="relativetime">Sep 21 '08 at 16:38</span>
                                                        </div>
                                                        <div class="user-gravatar32">
                                                            <a href="/users/17095/william-keller"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/e6d232754fc494bbb00e271a0e5ad538?s=32&d=identicon&r=PG" alt=""></div></a>
                                                        </div>
                                                        <div class="user-details">
                                                            <a href="/users/17095/william-keller">William Keller</a><br>
                                                            <span class="reputation-score" title="reputation score " dir="ltr">2,805</span><span title="13 silver badges"><span class="badge2"></span><span class="badgecount">13</span></span><span title="20 bronze badges"><span class="badge3"></span><span class="badgecount">20</span></span>
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>

                                <tr>
                                    <td class="votecell"></td>
                                    <td>
                                        <div id="comments-111374" class="comments  dno" data-localized="true">
                                            <table>
                                                <tbody data-remaining-comments-count="0"
                                                       data-addlink-html="add comment"
                                                       data-addlink-disabled="true">
                                                    <tr><td></td><td></td></tr>
                                                </tbody>
                                            </table>
                                        </div>
                                        <a id="comments-link-111374" data-rep=50 data-anon=true
                                           class="comments-link disabled-link"
                                           title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add comment</a>
                                    </td>
                                </tr>
                            </table>
                        </div>


                        <a name="19260977"></a>
                        <div id="answer-19260977" class="answer" data-answerid="19260977">
                            <table>
                                <tr>
                                    <td class="votecell">


                                        <div class="vote">
                                            <input type="hidden" name="_id_" value="19260977">
                                            <a class="vote-up-off" title="This answer is useful">up vote</a>
                                            <span class="vote-count-post ">0</span>
                                            <a class="vote-down-off" title="This answer is not useful">down vote</a>



                                        </div>

                                    </td>



                                    <td class="answercell">
                                        <div class="post-text">
                                            <p>This is a good way of collecting performance information for the specific operation.</p>

<pre><code>start = new Date().getTime(); 
for (var n = 0; n &lt; maxCount; n++) {
/* perform the operation to be measured *//
}
elapsed = new Date().getTime() - start;
assert(true,"Measured time: " + elapsed);
</code></pre>

                                        </div>
                                        <table class="fw">
                                            <tr>
                                                <td class="vt">
                                                    <div class="post-menu"><a href="/a/19260977" title="short permalink to this answer" class="short-link" id="link-post-19260977">share</a><span class="lsep">|</span><a href="/posts/19260977/edit" class="suggest-edit-post" title="">improve this answer</a></div>
                                                </td>



                                                <td align="right" class="post-signature">


                                                    <div class="user-info ">
                                                        <div class="user-action-time">
                                                            answered <span title="2013-10-09 00:33:41Z" class="relativetime">Oct 9 '13 at 0:33</span>
                                                        </div>
                                                        <div class="user-gravatar32">
                                                            <a href="/users/2601995/user2601995"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/9d14330a7e4f88a9818231701481f2a5?s=32&d=identicon&r=PG" alt=""></div></a>
                                                        </div>
                                                        <div class="user-details">
                                                            <a href="/users/2601995/user2601995">user2601995</a><br>
                                                            <span class="reputation-score" title="reputation score " dir="ltr">577</span><span title="1 gold badge"><span class="badge1"></span><span class="badgecount">1</span></span><span title="6 silver badges"><span class="badge2"></span><span class="badgecount">6</span></span><span title="16 bronze badges"><span class="badge3"></span><span class="badgecount">16</span></span>
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>

                                <tr>
                                    <td class="votecell"></td>
                                    <td>
                                        <div id="comments-19260977" class="comments  dno" data-localized="true">
                                            <table>
                                                <tbody data-remaining-comments-count="0"
                                                       data-addlink-html="add comment"
                                                       data-addlink-disabled="true">
                                                    <tr><td></td><td></td></tr>
                                                </tbody>
                                            </table>
                                        </div>
                                        <a id="comments-link-19260977" data-rep=50 data-anon=true
                                           class="comments-link disabled-link"
                                           title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add comment</a>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <a name='new-answer'></a>
                        <form id="post-form" action="/questions/111368/answer/submit" method="post" class="post-form">
                            <input type="hidden" id="post-id" value="111368" />
                            <input type="hidden" id="qualityBanWarningShown" name="qualityBanWarningShown" value="false" />
                            <h2 class="space">Your Answer</h2>





                            <div id="post-editor" class="post-editor">

                                <div style="position: relative;">
                                    <div class="wmd-container">
                                        <div id="wmd-button-bar" class="wmd-button-bar"></div>
                                        <textarea id="wmd-input" class="wmd-input" name="post-text" cols="92" rows="15" tabindex="101" data-min-length=""></textarea>
                                    </div>
                                </div>

                                <div class="fl" style="margin-top: 8px; height:24px;">&nbsp;</div>
                                <div id="draft-saved" class="draft-saved community-option fl" style="margin-top: 8px; height:24px; display:none;">draft saved</div>

                                <div id="draft-discarded" class="draft-discarded community-option fl" style="margin-top: 8px; height:24px; display:none;">draft discarded</div>



                                <div id="wmd-preview" class="wmd-preview"></div>
                                <div></div>
                                <div class="edit-block">
                                    <input id="fkey" name="fkey" type="hidden" value="c5dc5fabf5e04aa13a75c2704c3db70c">
                                    <input id="author" name="author" type="text">
                                </div>
                            </div>
                            <div style="position: relative;">

                                <div class="form-item dno new-post-login">

                                    <div class="new-login-form">
                                        <div class="new-login-left">
                                            <h3>Sign up or <a id="login-link" href="/users/login?returnurl=%2fquestions%2f111368%2fhow-do-you-performance-test-javascript-code%23new-answer">log in</a></h3>
                                         
                                            <div class="preferred-login google-login">
                                                <p><span class="icon"></span><span>Sign up using Google</span></p>
                                            </div>
                                            <div class="preferred-login facebook-login">
                                                <p><span class="icon"></span><span>Sign up using Facebook</span></p>
                                            </div>
                                            <div class="preferred-login stackexchange-login">
                                                <p><span class="icon"></span><span>Sign up using Stack Exchange</span></p>
                                            </div>
                                        </div>
                                        <input type="hidden" name="manual-openid" class="manual-openid" />
                                        <input type="hidden" name="use-facebook" class="use-facebook" value="false" />
                                        <input type="button" class="submit-openid" value="Submit" style="display:none" />
                                        <div class="new-login-right">
                                            <h3>Post as a guest</h3>
                                            <div class="form-item">
                                                <table>
                                                    <tr>
                                                   
                                                        <td class="vm">
                                                            <div>
                                                                <label for="display-name">Name</label>
                                                                <input id="display-name" name="display-name" type="text" size="30" maxlength="30" value="" tabindex="105">
                                                            </div>
                                                            <div>
                                                                <label for="m-address">Email</label>
                                                                <input id="m-address" name="m-address" type="text" size="30" maxlength="100" value="" tabindex="106">
                                                                <span class="edit-field-overlay">required, but not shown</span>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </div>

                                        </div>
                                    </div>
                                </div>
                            
                                <noscript>
                                    <h3>Post as a guest</h3>
                                    <div class="form-item">
                                        <table>
                                            <tr>
                                           
                                                <td class="vm">
                                                    <div>
                                                        <label for="display-name">Name</label>
                                                        <input id="display-name" name="display-name" type="text" size="30" maxlength="30" value="" tabindex="105">
                                                    </div>
                                                    <div>
                                                        <label for="m-address">Email</label>
                                                        <input id="m-address" name="m-address" type="text" size="30" maxlength="100" value="" tabindex="106">
                                                        <span class="edit-field-overlay">required, but not shown</span>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </div>

                                </noscript>
                            </div>

                            <div class="form-submit cbt">
                                <input id="submit-button" type="submit" value="Post Your Answer" tabindex="110">
                                <a href="#" class="discard-answer dno">discard</a>

                                <p class="privacy-policy-agreement">
                                    By posting your answer, you agree to the <a href='http://stackexchange.com/legal/privacy-policy' target='_blank'>privacy policy</a> and <a href='http://stackexchange.com/legal/terms-of-service' target='_blank'>terms of service</a>.
                                </p>
                                <input type="hidden" name="legalLinksShown" value="1" />
                            </div>
                        </form>



                        <h2 class="bottom-notice" data-loc="1">
                            Not the answer you&#39;re looking for?							Browse other questions tagged <a href="/questions/tagged/javascript" class="post-tag" title="show questions tagged &#39;javascript&#39;" rel="tag">javascript</a> <a href="/questions/tagged/performance" class="post-tag" title="show questions tagged &#39;performance&#39;" rel="tag">performance</a>  or <a href="/questions/ask">ask your own question</a>.
                        </h2>
                    </div>
                </div>
                <div id="sidebar" class="show-votes">
                    <div class="module question-stats">
                        <table id="qinfo">
                            <tr>
                                <td>
                                    <p class="label-key">asked</p>
                                </td>
                                <td style="padding-left: 10px">
                                    <p class="label-key" title="2008-09-21 16:35:58Z"><b>5 years ago</b></p>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <p class="label-key">viewed</p>
                                </td>

                                <td style="padding-left: 10px">
                                    <p class="label-key">
                                        <b>48236 times</b>
                                    </p>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <p class="label-key">active</p>
                                </td>
                                <td style="padding-left: 10px">
                                    <p class="label-key"><b><a href="?lastactivity" class="lastactivity-link" title="2013-10-09 00:33:41Z">8 months ago</a></b></p>
                                </td>
                            </tr>
                        </table>
                    </div>

                 
                    <div class="everyonelovesstackoverflow" id="adzerk1360974287">
                    </div>
                    <div id="hireme">
                     
                    </div>
                    <div style="margin-bottom: 10px;">


                        <style type="text/css">
                            #newsletter-ad {
                                width: 190px;
                                height: 250px;
                                overflow: hidden;
                                background: url('//cdn.sstatic.net/stackoverflow/img/newsletter-ad.png');
                                padding: 0 15px 0 15px;
                            }

                            #newsletter-ad-header {
                                margin-top: 60px;
                            }

                            #newsletter-ad ul {
                                margin: 1em 0 1em 1.5em;
                            }

                                #newsletter-ad ul li {
                                    margin-bottom: 5px;
                                }

                            #newsletter-signup-container {
                                text-align: center;
                            }

                            #newsletter-preview-container {
                                margin-top: 10px;
                                text-align: center;
                            }

                            #newsletter-email-input {
                                width: 200px;
                            }
                        </style>

                     

                        <div id="newsletter-ad">
                            <p id="newsletter-ad-header">Get the <b>weekly newsletter!</b></p>
                            <ul>
                                <li>Top questions and answers</li>
                                <li>Important announcements</li>
                                <li>Unanswered questions</li>
                            </ul>
                            <div id="newsletter-signup-container"><input id="newsletter-signup" type="button" value="Sign up for the newsletter" /></div>
                            <p id="newsletter-preview-container">see an <a href="http://stackexchange.com/newsletters/newsletter?site=stackoverflow.com" id="newsletter-preview">example newsletter</a></p>
                            <div class="dno">

                                <p class="privacy-policy-agreement">
                                    By subscribing, you agree to the <a href='http://stackexchange.com/legal/privacy-policy' target='_blank'>privacy policy</a> and <a href='http://stackexchange.com/legal/terms-of-service' target='_blank'>terms of service</a>.
                                </p>
                                <input type="hidden" name="legalLinksShown" value="1" />
                            </div>
                        </div>

                    </div>

                    <div class="module sidebar-linked">
                        <h4 id="h-linked">Linked</h4>
                        <div class="linked" data-tracker="lq=1">
                            <div class="spacer">
                                <a href="/q/11797246" title="Vote score (upvotes - downvotes)">
                                    <div class="answer-votes  default">1</div>
                                </a>
                                <a href="/questions/11797246/how-to-determine-which-code-is-faster" class="question-hyperlink">How to determine which code is faster?</a>
                            </div><div class="spacer">
                                <a href="/q/15391009" title="Vote score (upvotes - downvotes)">
                                    <div class="answer-votes  default">22</div>
                                </a>
                                <a href="/questions/15391009/detect-graphics-card-performance-js" class="question-hyperlink">Detect Graphics card performance - JS</a>
                            </div><div class="spacer">
                                <a href="/q/4685536" title="Vote score (upvotes - downvotes)">
                                    <div class="answer-votes  default">10</div>
                                </a>
                                <a href="/questions/4685536/how-to-check-and-test-how-much-memory-a-javascript-app-is-leaking" class="question-hyperlink">How to check and test how much memory a javascript app is leaking</a>
                            </div><div class="spacer">
                                <a href="/q/10192712" title="Vote score (upvotes - downvotes)">
                                    <div class="answer-votes answered-accepted default">6</div>
                                </a>
                                <a href="/questions/10192712/css-selectors-performance-dom-parsing" class="question-hyperlink">CSS Selectors performance, DOM Parsing</a>
                            </div><div class="spacer">
                                <a href="/q/6380627" title="Vote score (upvotes - downvotes)">
                                    <div class="answer-votes answered-accepted default">2</div>
                                </a>
                                <a href="/questions/6380627/how-to-performance-tune-a-jquery-mobile-ios-android-web-app" class="question-hyperlink">How to Performance Tune a jQuery Mobile iOS/Android Web App</a>
                            </div><div class="spacer">
                                <a href="/q/7690553" title="Vote score (upvotes - downvotes)">
                                    <div class="answer-votes  default">0</div>
                                </a>
                                <a href="/questions/7690553/javascript-switch-vs-loop-on-array" class="question-hyperlink">javascript switch vs loop on array</a>
                            </div><div class="spacer">
                                <a href="/q/18513028" title="Vote score (upvotes - downvotes)">
                                    <div class="answer-votes answered-accepted default">1</div>
                                </a>
                                <a href="/questions/18513028/how-can-i-show-a-loader-during-knockout-js-initialization" class="question-hyperlink">How can i show a &ldquo;loader&rdquo; during knockout.js initialization?</a>
                            </div><div class="spacer">
                                <a href="/q/3593294" title="Vote score (upvotes - downvotes)">
                                    <div class="answer-votes answered-accepted default">4</div>
                                </a>
                                <a href="/questions/3593294/which-methods-do-you-prefer-to-test-the-speed-of-your-javascript-and-why" class="question-hyperlink">Which methods do you prefer to test the speed of your Javascript, and why?</a>
                            </div><div class="spacer">
                                <a href="/q/11623812" title="Vote score (upvotes - downvotes)">
                                    <div class="answer-votes answered-accepted default">1</div>
                                </a>
                                <a href="/questions/11623812/how-to-find-better-implementation-of-a-function-in-javascript" class="question-hyperlink">how to find better implementation of a function in javascript</a>
                            </div><div class="spacer">
                                <a href="/q/13408180" title="Vote score (upvotes - downvotes)">
                                    <div class="answer-votes  default">0</div>
                                </a>
                                <a href="/questions/13408180/how-to-check-speed-of-javascript-code-execution" class="question-hyperlink">How to check speed of JavaScript code execution</a>
                            </div>					<div class="spacer more">
                                <a href="http://stackoverflow.com/questions/linked/111368">see more linked questions…</a>
                            </div>
                        </div>
                    </div>

                    <div class="module sidebar-related">
                        <h4 id="h-related">Related</h4>
                        <div class="related js-gps-related-questions" data-tracker="rq=1">
                            <div class="spacer">
                                <a href="/q/53738" title="Vote score (upvotes - downvotes)">
                                    <div class="answer-votes default">
                                        32
                                    </div>
                                </a><a href="/questions/53738/how-do-you-test-the-performance-of-a-website" class="question-hyperlink">How do you test the performance of a website?</a>
                            </div>
                            <div class="spacer">
                                <a href="/q/111102" title="Vote score (upvotes - downvotes)">
                                    <div class="answer-votes answered-accepted extra-large">
                                        2773
                                    </div>
                                </a><a href="/questions/111102/how-do-javascript-closures-work" class="question-hyperlink">How do JavaScript closures work?</a>
                            </div>
                            <div class="spacer">
                                <a href="/q/134845" title="Vote score (upvotes - downvotes)">
                                    <div class="answer-votes extra-large">
                                        1704
                                    </div>
                                </a><a href="/questions/134845/href-attribute-for-javascript-links-or-javascriptvoid0" class="question-hyperlink">Href attribute for JavaScript links: &ldquo;#&rdquo; or &ldquo;javascript:void(0)&rdquo;?</a>
                            </div>
                            <div class="spacer">
                                <a href="/q/221294" title="Vote score (upvotes - downvotes)">
                                    <div class="answer-votes answered-accepted extra-large">
                                        1313
                                    </div>
                                </a><a href="/questions/221294/how-do-you-get-a-timestamp-in-javascript" class="question-hyperlink">How do you get a timestamp in JavaScript?</a>
                            </div>
                            <div class="spacer">
                                <a href="/q/503093" title="Vote score (upvotes - downvotes)">
                                    <div class="answer-votes answered-accepted extra-large">
                                        2524
                                    </div>
                                </a><a href="/questions/503093/how-can-i-make-a-redirect-page-in-jquery-javascript" class="question-hyperlink">How can I make a redirect page in jQuery/JavaScript?</a>
                            </div>
                            <div class="spacer">
                                <a href="/q/901115" title="Vote score (upvotes - downvotes)">
                                    <div class="answer-votes answered-accepted extra-large">
                                        2596
                                    </div>
                                </a><a href="/questions/901115/how-can-i-get-query-string-values-in-javascript" class="question-hyperlink">How can I get query string values in JavaScript?</a>
                            </div>
                            <div class="spacer">
                                <a href="/q/1711631" title="Vote score (upvotes - downvotes)">
                                    <div class="answer-votes answered-accepted large">
                                        963
                                    </div>
                                </a><a href="/questions/1711631/how-do-i-improve-the-performance-of-sqlite" class="question-hyperlink">How do I improve the performance of SQLite?</a>
                            </div>
                            <div class="spacer">
                                <a href="/q/9271276" title="Vote score (upvotes - downvotes)">
                                    <div class="answer-votes answered-accepted large">
                                        534
                                    </div>
                                </a><a href="/questions/9271276/is-the-recommendation-to-include-css-before-javascript-invalid" class="question-hyperlink">Is the recommendation to include CSS before JavaScript invalid?</a>
                            </div>
                            <div class="spacer">
                                <a href="/q/9739414" title="Vote score (upvotes - downvotes)">
                                    <div class="answer-votes default">
                                        1
                                    </div>
                                </a><a href="/questions/9739414/how-to-performance-test-javascript-in-a-web-page-on-iphone" class="question-hyperlink">How to performance test JavaScript in a web page on iPhone?</a>
                            </div>
                            <div class="spacer">
                                <a href="/q/11227809" title="Vote score (upvotes - downvotes)">
                                    <div class="answer-votes answered-accepted extra-large">
                                        7933
                                    </div>
                                </a><a href="/questions/11227809/why-is-processing-a-sorted-array-faster-than-an-unsorted-array" class="question-hyperlink">Why is processing a sorted array faster than an unsorted array?</a>
                            </div>

                        </div>
                    </div>

                    <div id="hot-network-questions" class="module">
                        <h4>
                            <a href="//stackexchange.com/questions?tab=hot"
                               class="js-gps-track"
                               data-gps-track="posts_hot_network.click({ item_type:1, location:11 })">
                                Hot Network Questions
                            </a>
                        </h4>
                        <ul>
                            <li>
                                <div class="favicon favicon-academia" title="Academia Stack Exchange"></div><a href="http://academia.stackexchange.com/questions/22098/how-much-does-topic-and-supervisor-matter-for-honours-in-computer-science-when-t" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:415 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    How much does topic and supervisor matter for honours in computer science when the aim is ultimately to do a PhD?
                                </a>

                            </li>
                            <li>
                                <div class="favicon favicon-codegolf" title="Programming Puzzles &amp; Code Golf Stack Exchange"></div><a href="http://codegolf.stackexchange.com/questions/30051/write-a-piece-of-code-to-output-the-line-number-of-the-print-output-statement" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:200 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    Write a piece of code to output the line number of the print / output statement itself (in the form &quot;Hello World, from line X!&quot;)
                                </a>

                            </li>
                            <li>
                                <div class="favicon favicon-christianity" title="Christianity Stack Exchange"></div><a href="http://christianity.stackexchange.com/questions/29813/if-thou-shall-not-kill-is-a-commandment-how-come-god-kills-people" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:304 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    If &quot;Thou Shall not Kill&quot; is a commandment, how come God kills People?
                                </a>

                            </li>
                            <li>
                                <div class="favicon favicon-puzzling" title="Puzzling Stack Exchange"></div><a href="http://puzzling.stackexchange.com/questions/626/paying-the-troll-toll" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:559 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    Paying the Troll toll
                                </a>

                            </li>
                            <li>
                                <div class="favicon favicon-mathematica" title="Mathematica Stack Exchange"></div><a href="http://mathematica.stackexchange.com/questions/50363/graph-from-binary-matrix-not-adjacency-respecting-the-original-matrix-position" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:387 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    Graph from binary matrix (not adjacency) respecting the original matrix positions
                                </a>

                            </li>
                            <li class="dno js-hidden">
                                <div class="favicon favicon-programmers" title="Programmers Stack Exchange"></div><a href="http://programmers.stackexchange.com/questions/244363/why-is-programming-sometimes-viewed-as-a-second-rate-role" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:131 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    Why is programming sometimes viewed as a second-rate role?
                                </a>

                            </li>
                            <li class="dno js-hidden">
                                <div class="favicon favicon-electronics" title="Electrical Engineering Stack Exchange"></div><a href="http://electronics.stackexchange.com/questions/113536/how-would-one-attach-an-optical-fibre-to-a-pcb-for-a-display" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:135 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    How would one attach an optical fibre to a PCB for a display?
                                </a>

                            </li>
                            <li class="dno js-hidden">
                                <div class="favicon favicon-stackoverflow" title="Stack Overflow"></div><a href="http://stackoverflow.com/questions/24110347/what-is-the-reason-behind-the-extra-padding-in-structs" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:1 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    What is the reason behind the extra padding in structs?
                                </a>

                            </li>
                            <li class="dno js-hidden">
                                <div class="favicon favicon-music" title="Musical Practice &amp; Performance Stack Exchange"></div><a href="http://music.stackexchange.com/questions/19057/how-to-escape-the-c-major-trap-when-improvising-on-the-piano" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:240 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    How to escape the C Major trap when improvising on the piano
                                </a>

                            </li>
                            <li class="dno js-hidden">
                                <div class="favicon favicon-askubuntu" title="Ask Ubuntu"></div><a href="http://askubuntu.com/questions/480572/what-does-it-take-for-a-desktop-environment-of-my-choice-to-have-its-own-officia" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:89 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    What does it take for a desktop environment of my choice to have its own official Ubuntu derivative?
                                </a>

                            </li>
                            <li class="dno js-hidden">
                                <div class="favicon favicon-tex" title="TeX - LaTeX Stack Exchange"></div><a href="http://tex.stackexchange.com/questions/183866/tree-with-six-or-more-children" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:85 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    Tree with six or more children
                                </a>

                            </li>
                            <li class="dno js-hidden">
                                <div class="favicon favicon-scifi" title="Science Fiction &amp; Fantasy Stack Exchange"></div><a href="http://scifi.stackexchange.com/questions/58909/why-didnt-sauron-attack-the-shire-if-he-knew-a-hobbit-would-defeat-him" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:186 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    Why didn&#39;t Sauron attack the Shire if he knew a Hobbit would defeat him?
                                </a>

                            </li>
                            <li class="dno js-hidden">
                                <div class="favicon favicon-tex" title="TeX - LaTeX Stack Exchange"></div><a href="http://tex.stackexchange.com/questions/183848/how-draw-part-of-ring-or-broken-ring-in-tikz" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:85 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    How draw part of ring or broken ring in TikZ?
                                </a>

                            </li>
                            <li class="dno js-hidden">
                                <div class="favicon favicon-space" title="Space Exploration Stack Exchange"></div><a href="http://space.stackexchange.com/questions/4741/why-didnt-the-apollo-program-do-an-uncrewed-landing-ascent-rehearsal" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:508 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    Why didn&#39;t the Apollo program do an uncrewed landing/ascent rehearsal?
                                </a>

                            </li>
                            <li class="dno js-hidden">
                                <div class="favicon favicon-wordpress" title="WordPress Development Stack Exchange"></div><a href="http://wordpress.stackexchange.com/questions/148951/relative-links-for-performance" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:110 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    Relative links for performance?
                                </a>

                            </li>
                            <li class="dno js-hidden">
                                <div class="favicon favicon-blender" title="Blender Stack Exchange"></div><a href="http://blender.stackexchange.com/questions/11078/how-to-add-an-edge-without-interfering-with-other-edges" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:502 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    How to add an edge without interfering with other edges?
                                </a>

                            </li>
                            <li class="dno js-hidden">
                                <div class="favicon favicon-blender" title="Blender Stack Exchange"></div><a href="http://blender.stackexchange.com/questions/12081/create-hollow-intersecting-tubes" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:502 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    Create hollow intersecting tubes
                                </a>

                            </li>
                            <li class="dno js-hidden">
                                <div class="favicon favicon-stackoverflow" title="Stack Overflow"></div><a href="http://stackoverflow.com/questions/24109737/what-are-some-uses-of-decltypeauto" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:1 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    What are some uses of decltype(auto)?
                                </a>

                            </li>
                            <li class="dno js-hidden">
                                <div class="favicon favicon-salesforce" title="Salesforce Stack Exchange"></div><a href="http://salesforce.stackexchange.com/questions/39953/how-frequently-does-salesforce-refresh-dns-information" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:459 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    How frequently does Salesforce refresh DNS information?
                                </a>

                            </li>
                            <li class="dno js-hidden">
                                <div class="favicon favicon-softwarerecs" title="Software Recommendations Stack Exchange"></div><a href="http://softwarerecs.stackexchange.com/questions/6778/i-need-an-application-that-logs-the-time-spent-on-games" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:536 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    I need an application that logs the time spent on games
                                </a>

                            </li>
                            <li class="dno js-hidden">
                                <div class="favicon favicon-rpg" title="Role-playing Games Stack Exchange"></div><a href="http://rpg.stackexchange.com/questions/40714/how-to-make-a-fake-fortune-teller" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:122 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    How to make a fake fortune teller?
                                </a>

                            </li>
                            <li class="dno js-hidden">
                                <div class="favicon favicon-parenting" title="Parenting Stack Exchange"></div><a href="http://parenting.stackexchange.com/questions/12890/how-do-i-approach-my-13-year-old-daughters-confusion-regarding-her-sexuality" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:228 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    How do I approach my 13-year-old daughter&#39;s confusion regarding her sexuality?
                                </a>

                            </li>
                            <li class="dno js-hidden">
                                <div class="favicon favicon-english" title="English Language &amp; Usage Stack Exchange"></div><a href="http://english.stackexchange.com/questions/176776/a-single-word-name-for-the-i-dont-know-gesture" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:97 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    A single word name for the &quot;I don&#39;t know&quot; gesture
                                </a>

                            </li>
                            <li class="dno js-hidden">
                                <div class="favicon favicon-biology" title="Biology Stack Exchange"></div><a href="http://biology.stackexchange.com/questions/17980/do-women-have-testosterone" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:375 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    Do women have testosterone?
                                </a>

                            </li>
                        </ul>

                        <a href="#"
                           class="show-more js-show-more js-gps-track"
                           data-gps-track="posts_hot_network.click({ item_type:3, location:11 })">
                            more hot questions
                        </a>
                    </div>
                </div>

                <div id="feed-link">
                    <div id="feed-link-text">
                        <a href="/feeds/question/111368" title="feed of this question and its answers">
                            <span class="feed-icon"></span>question feed
                        </a>
                    </div>
                </div>
             

                <noscript>
                    <div><img src="/posts/111368/ivc/0b91" class="dno" alt="" width="0" height="0"></div>
                </noscript><div style="display:none" id="prettify-lang">default</div>
            </div>



        </div>
    </div>
    <div id="footer" class="categories">
        <div class="footerwrap">
            <div id="footer-menu">
                <div class="top-footer-links">
                    <a href="/about">about</a>
                    <a href="/help">help</a>
                    <a href="/help/badges">badges</a>
                    <a href="http://blog.stackoverflow.com?blb=1">blog</a>
                    <a href="http://chat.stackoverflow.com">chat</a>
                    <a href="http://data.stackexchange.com">data</a>
                    <a href="http://stackexchange.com/legal">legal</a>
                    <a href="http://stackexchange.com/legal/privacy-policy">privacy policy</a>
                    <a href="http://stackexchange.com/about/hiring">jobs</a>
                    <a href="http://engine.adzerk.net/r?e=eyJhdiI6NDE0LCJhdCI6MjAsImNtIjo5NTQsImNoIjoxMTc4LCJjciI6Mjc3NiwiZG0iOjQsImZjIjoyODYyLCJmbCI6Mjc1MSwibnciOjIyLCJydiI6MCwicHIiOjExNSwic3QiOjAsInVyIjoiaHR0cDovL3N0YWNrb3ZlcmZsb3cuY29tL2Fib3V0L2NvbnRhY3QiLCJyZSI6MX0&s=hRods5B22XvRBwWIwtIMekcyNF8">advertising info</a>

                    <a onclick='StackExchange.switchMobile("on")'>mobile</a>
                    <b><a href="/contact">contact us</a></b>
                    <b><a href="http://meta.stackoverflow.com">feedback</a></b>

                </div>
                <div id="footer-sites">
                    <table>
                        <tr>
                            <th colspan=3>
                                Technology
                            </th>
                            <th>
                                Life / Arts
                            </th>
                            <th>
                                Culture / Recreation
                            </th>
                            <th>
                                Science
                            </th>
                            <th>
                                Other
                            </th>
                        </tr>
                        <tr>
                            <td>
                                <ol>
                                    <li><a href="http://stackoverflow.com" title="professional and enthusiast programmers">Stack Overflow</a></li>
                                    <li><a href="http://serverfault.com" title="professional system and network administrators">Server Fault</a></li>
                                    <li><a href="http://superuser.com" title="computer enthusiasts and power users">Super User</a></li>
                                    <li><a href="http://webapps.stackexchange.com" title="power users of web applications">Web Applications</a></li>
                                    <li><a href="http://askubuntu.com" title="Ubuntu users and developers">Ask Ubuntu</a></li>
                                    <li><a href="http://webmasters.stackexchange.com" title="pro webmasters">Webmasters</a></li>
                                    <li><a href="http://gamedev.stackexchange.com" title="professional and independent game developers">Game Development</a></li>
                                    <li><a href="http://tex.stackexchange.com" title="users of TeX, LaTeX, ConTeXt, and related typesetting systems">TeX - LaTeX</a></li>
                                </ol>
                            </td>
                            <td>
                                <ol>
                                    <li><a href="http://programmers.stackexchange.com" title="professional programmers interested in conceptual questions about software development">Programmers</a></li>
                                    <li><a href="http://unix.stackexchange.com" title="users of Linux, FreeBSD and other Un*x-like operating systems.">Unix &amp; Linux</a></li>
                                    <li><a href="http://apple.stackexchange.com" title="power users of Apple hardware and software">Ask Different (Apple)</a></li>
                                    <li><a href="http://wordpress.stackexchange.com" title="WordPress developers and administrators">WordPress Development</a></li>
                                    <li><a href="http://gis.stackexchange.com" title="cartographers, geographers and GIS professionals">Geographic Information Systems</a></li>
                                    <li><a href="http://electronics.stackexchange.com" title="electronics and electrical engineering professionals, students, and enthusiasts">Electrical Engineering</a></li>
                                    <li><a href="http://android.stackexchange.com" title="enthusiasts and power users of the Android operating system">Android Enthusiasts</a></li>
                                    <li><a href="http://security.stackexchange.com" title="Information security professionals">Information Security</a></li>
                                </ol>
                            </td>
                            <td>
                                <ol>
                                    <li><a href="http://dba.stackexchange.com" title="database professionals who wish to improve their database skills and learn from others in the community">Database Administrators</a></li>
                                    <li><a href="http://drupal.stackexchange.com" title="Drupal developers and administrators">Drupal Answers</a></li>
                                    <li><a href="http://sharepoint.stackexchange.com" title="SharePoint enthusiasts">SharePoint</a></li>
                                    <li><a href="http://ux.stackexchange.com" title="user experience researchers and experts">User Experience</a></li>
                                    <li><a href="http://mathematica.stackexchange.com" title="users of Mathematica">Mathematica</a></li>

                                    <li>
                                        <a href="http://stackexchange.com/sites#technology" class="more">
                                            more (14)
                                        </a>
                                    </li>
                                </ol>
                            </td>
                            <td>
                                <ol>
                                    <li><a href="http://photo.stackexchange.com" title="professional, enthusiast and amateur photographers">Photography</a></li>
                                    <li><a href="http://scifi.stackexchange.com" title="science fiction and fantasy enthusiasts">Science Fiction &amp; Fantasy</a></li>
                                    <li><a href="http://graphicdesign.stackexchange.com" title="professional graphic designers and non-designers trying to do their own graphic design">Graphic Design</a></li>
                                    <li><a href="http://cooking.stackexchange.com" title="professional and amateur chefs">Seasoned Advice (cooking)</a></li>
                                    <li><a href="http://diy.stackexchange.com" title="contractors and serious DIYers">Home Improvement</a></li>
                                    <li><a href="http://money.stackexchange.com" title="people who want to be financially literate">Personal Finance &amp; Money</a></li>
                                    <li><a href="http://academia.stackexchange.com" title="academics and those enrolled in higher education">Academia</a></li>

                                    <li>
                                        <a href="http://stackexchange.com/sites#lifearts" class="more">
                                            more (10)
                                        </a>
                                    </li>
                                </ol>
                            </td>
                            <td>
                                <ol>
                                    <li><a href="http://english.stackexchange.com" title="linguists, etymologists, and serious English language enthusiasts">English Language &amp; Usage</a></li>
                                    <li><a href="http://skeptics.stackexchange.com" title="scientific skepticism">Skeptics</a></li>
                                    <li><a href="http://judaism.stackexchange.com" title="those who base their lives on Jewish law and tradition and anyone interested in learning more">Mi Yodeya (Judaism)</a></li>
                                    <li><a href="http://travel.stackexchange.com" title="road warriors and seasoned travelers">Travel</a></li>
                                    <li><a href="http://christianity.stackexchange.com" title="committed Christians, experts in Christianity and those interested in learning more">Christianity</a></li>
                                    <li><a href="http://gaming.stackexchange.com" title="passionate videogamers on all platforms">Arqade (gaming)</a></li>
                                    <li><a href="http://bicycles.stackexchange.com" title="people who build and repair bicycles, people who train cycling, or commute on bicycles">Bicycles</a></li>
                                    <li><a href="http://rpg.stackexchange.com" title="gamemasters and players of tabletop, paper-and-pencil role-playing games">Role-playing Games</a></li>

                                    <li>
                                        <a href="http://stackexchange.com/sites#culturerecreation" class="more">
                                            more (21)
                                        </a>
                                    </li>
                                </ol>
                            </td>
                            <td>
                                <ol>
                                    <li><a href="http://math.stackexchange.com" title="people studying math at any level and professionals in related fields">Mathematics</a></li>
                                    <li><a href="http://stats.stackexchange.com" title="people interested in statistics, machine learning, data analysis, data mining, and data visualization">Cross Validated (stats)</a></li>
                                    <li><a href="http://cstheory.stackexchange.com" title="theoretical computer scientists and researchers in related fields">Theoretical Computer Science</a></li>
                                    <li><a href="http://physics.stackexchange.com" title="active researchers, academics and students of physics">Physics</a></li>
                                    <li><a href="http://mathoverflow.net" title="professional mathematicians">MathOverflow</a></li>

                                    <li>
                                        <a href="http://stackexchange.com/sites#science" class="more">
                                            more (7)
                                        </a>
                                    </li>
                                </ol>
                            </td>
                            <td>
                                <ol>
                                    <li><a href="http://stackapps.com" title="apps, scripts, and development with the Stack Exchange API">Stack Apps</a></li>
                                    <li><a href="http://meta.stackexchange.com" title="meta-discussion of the Stack Exchange family of Q&amp;A websites">Meta Stack Exchange</a></li>
                                    <li><a href="http://area51.stackexchange.com" title="proposing new sites in the Stack Exchange network">Area 51</a></li>
                                    <li><a href="http://careers.stackoverflow.com">Stack Overflow Careers</a></li>

                                </ol>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>

            <div id="copyright">
                site design / logo &#169; 2014 stack exchange inc; user contributions licensed under <a href="http://creativecommons.org/licenses/by-sa/3.0/" rel="license">cc by-sa 3.0</a>
                with <a href="http://blog.stackoverflow.com/2009/06/attribution-required/" rel="license">attribution required</a>
            </div>
            <div id="svnrev">
                rev 2014.6.8.1646
            </div>

        </div>
    </div>
    <noscript><div id="noscript-padding"></div></noscript>
    <div id="notify-container"></div>
    <div id="overlay-header"></div>
    <div id="custom-header"></div>
    <div class="topbar">
        <div class="topbar-wrapper">

            <div class="js-topbar-dialog-corral">

                <div class="topbar-dialog siteSwitcher-dialog dno">
                    <div class="header">
                        <h3><a href="//stackoverflow.com">current community</a></h3>
                    </div>
                    <div class="modal-content current-site-container">
                        <ul class="current-site">
                            <li>
                                <div class="related-links">
                                    <a href="http://chat.stackoverflow.com" data-gps-track="site_switcher.click({ item_type:6 })">chat</a>
                                    <a href="http://blog.stackoverflow.com" data-gps-track="site_switcher.click({ item_type:7 })">blog</a>
                                </div>




                                <a href="//stackoverflow.com"
                                   class="current-site-link site-link js-gps-track"
                                   data-id="1"
                                   data-gps-track="
        site_switcher.click({ item_type:3 })">
                                    <div class="site-icon favicon favicon-stackoverflow" title="Stack Overflow"></div>
                                    Stack Overflow
                                </a>

                            </li>
                            <li class="related-site">
                                <div class="L-shaped-icon-container">
                                    <span class="L-shaped-icon"></span>
                                </div>





                                <a href="http://meta.stackoverflow.com"
                                   class="site-link js-gps-track"
                                   data-id="552"
                                   data-gps-track="
            site.switch({ target_site:552, item_type:3 }),
        site_switcher.click({ item_type:4 })">
                                    <div class="site-icon favicon favicon-stackoverflowmeta" title="Meta Stack Overflow"></div>
                                    Meta Stack Overflow
                                </a>

                            </li>
                            <li class="related-site">
                                <div class="L-shaped-icon-container">
                                    <span class="L-shaped-icon"></span>
                                </div>

                                <a class="site-link"
                                   href="//careers.stackoverflow.com"
                                   data-gps-track="site_switcher.click({ item_type:9 })">
                                    <div class="site-icon favicon favicon-careers" title="Stack Overflow Careers"></div>
                                    Careers 2.0
                                </a>
                            </li>
                        </ul>
                    </div>

                    <div class="header" id="your-communities-header">
                        <h3>
                            your communities
                        </h3>

                    </div>
                    <div class="modal-content" id="your-communities-section">

                        <div class="call-to-login">
                            <a href="https://stackoverflow.com/users/signup?returnurl=http%3a%2f%2fstackoverflow.com%2fquestions%2f111368%2fhow-do-you-performance-test-javascript-code" class="js-gps-track" data-gps-track="site_switcher.click({ item_type:10 })">Sign up</a>
                            or
                            <a href="https://stackoverflow.com/users/login?returnurl=http%3a%2f%2fstackoverflow.com%2fquestions%2f111368%2fhow-do-you-performance-test-javascript-code" class="js-gps-track" data-gps-track="site_switcher.click({ item_type:11 })">log in</a>

                            to customize your list.
                        </div>
                    </div>

                    <div class="header">
                        <h3><a href="//stackexchange.com/sites">more stack exchange communities</a></h3>
                    </div>
                    <div class="modal-content">
                        <div class="child-content"></div>
                    </div>
                </div>
            </div>

            <div class="network-items">

                <a href="//stackexchange.com"
                   class="topbar-icon icon-site-switcher yes-hover js-site-switcher-button js-gps-track"
                   data-gps-track="site_switcher.show"
                   title="A list of all 126 Stack Exchange sites">
                    <span class="hidden-text">Stack Exchange</span>
                </a>

            </div>

            <div class="topbar-links">

                <div class="links-container">
                    <span class="topbar-menu-links">
                        <a href="https://stackoverflow.com/users/signup?returnurl=http%3a%2f%2fstackoverflow.com%2fquestions%2f111368%2fhow-do-you-performance-test-javascript-code" class="login-link">sign up</a>
                        <a href="https://stackoverflow.com/users/login?returnurl=http%3a%2f%2fstackoverflow.com%2fquestions%2f111368%2fhow-do-you-performance-test-javascript-code" class="login-link">log in</a>
                        <a href="/tour">tour</a>

                        <a href="#" class="icon-help js-help-button" title="Help Center and other resources">
                            help
                            <span class="triangle"></span>
                        </a>
                        <div class="topbar-dialog help-dialog js-help-dialog dno">
                            <div class="modal-content">
                                <ul>
                                    <li>
                                        <a href="/tour" class="js-gps-track" data-gps-track="help_popup.click({ item_type:1 })">
                                            Tour
                                            <span class="item-summary">
                                                Start here for a quick overview of the site
                                            </span>
                                        </a>
                                    </li>
                                    <li>
                                        <a href="/help" class="js-gps-track" data-gps-track="help_popup.click({ item_type:4 })">
                                            Help Center
                                            <span class="item-summary">
                                                Detailed answers to any questions you might have
                                            </span>
                                        </a>
                                    </li>
                                    <li>
                                        <a href="//meta.stackoverflow.com" class="js-gps-track" data-gps-track="help_popup.click({ item_type:2 })">
                                            Meta
                                            <span class="item-summary">
                                                Discuss the workings and policies of this site
                                            </span>
                                        </a>
                                    </li>
                                </ul>
                            </div>
                        </div>

                        <a href="//careers.stackoverflow.com">careers 2.0</a>
                    </span>
                </div>

                <div class="search-container">
                    <form id="search" action="/search" method="get" autocomplete="off">
                        <input name="q" type="text" placeholder="search" value="" tabindex="1" autocomplete="off" maxlength="240" />
                    </form>
                </div>

            </div>
        </div>
    </div>
    
        StackExchange.ready(function () { StackExchange.topbar.init(); });
   
    <div class="container">
        <div id="header" class=headeranon>
            <br class="cbt">
            <div id="hlogo">
                <a href="/">
                    Stack Overflow
                </a>
            </div>
            <div id="hmenus">
                <div class="nav mainnavs mainnavsanon">
                    <ul>
                        <li class="youarehere"><a id="nav-questions" href="/questions">Questions</a></li>
                        <li><a id="nav-tags" href="/tags">Tags</a></li>
                        <li><a id="nav-tour" href="/about">Tour</a></li>
                        <li><a id="nav-users" href="/users">Users</a></li>
                    </ul>
                </div>
                <div class="nav askquestion">
                    <ul>
                        <li>
                            <a id="nav-askquestion" href="/questions/ask">Ask Question</a>
                        </li>
                    </ul>
                </div>
            </div>
        </div>




        <div id="content">


            <div itemscope itemtype="http://schema.org/Article">
                <link itemprop="image" href="//cdn.sstatic.net/stackoverflow/img/apple-touch-icon.png">
                <!--googleoff: all-->

                <div id="herobox-mini">
                    <div id="hero-content">
                        <span id="controls">
                            <a href="/about" id="tell-me-more" class="button">Take the 2-minute tour</a>
                            <span id="close"><a title="click to dismiss">&times;</a></span>
                        </span>
                        <div id="blurb">
                            Stack Overflow is a question and answer site for professional and enthusiast programmers. It&#39;s 100% free, no registration required.
                        </div>
                    </div>
                    
                        $('#tell-me-more').click(function () {
                            var clickSource = $("body").attr("class") + '-mini';
                            if ($("body").hasClass("questions-page")) {
                                clickSource = 'questionpagemini';
                            } else if ($("body").hasClass("question-page")) {
                                clickSource = 'questionpagemini';
                            } else if ($("body").hasClass("home-page")) {
                                clickSource = 'homepagemini';
                            }

                            StackExchange.using("gps", function () {
                                StackExchange.gps.track("aboutpage.click", { aboutclick_location: clickSource }, true);
                            });
                        });
                        $('#herobox-mini #close').click(function () {
                            StackExchange.using("gps", function () {
                                StackExchange.gps.track("hero.action", { hero_action_type: "close" }, true);
                            });
                            $.cookie("hero", "none", { path: "/" });
                            var $hero = $("#herobox-mini");
                            $hero.slideUp('fast', function () { $hero.remove(); });
                            return false;
                        });
                   
                </div>
                <!--googleon: all-->
                <div id="question-header">
                    <h1 itemprop="name"><a href="/questions/111368/how-do-you-performance-test-javascript-code" class="question-hyperlink">How do you performance test JavaScript code?</a></h1>
                </div>
                <div id="mainbar">



                    <div class="question" data-questionid="111368" id="question">

                        
                            var ados = ados || {}; ados.run = ados.run || [];
                            ados.run.push(function () { ados_add_placement(22, 8277, "adzerk1743843474", 4).setZone(43); });
                       
                        <div class="everyonelovesstackoverflow" id="adzerk1743843474">
                        </div>    <table>
                            <tr>
                                <td class="votecell">


                                    <div class="vote">
                                        <input type="hidden" name="_id_" value="111368">
                                        <a class="vote-up-off" title="This question shows research effort; it is useful and clear">up vote</a>
                                        <span class="vote-count-post ">96</span>
                                        <a class="vote-down-off" title="This question does not show any research effort; it is unclear or not useful">down vote</a>

                                        <a class="star-off" href="#" title="This is a favorite question (click again to undo)">favorite</a>
                                        <div class="favoritecount"><b>51</b></div>

                                    </div>

                                </td>

                                <td class="postcell">
                                    <div>
                                        <div class="post-text" itemprop="description">

                                            <p>CPU Cycles, Memory Usage, Execution Time, etc.?</p>

                                            <p>Added: Is there a quantitative way of testing performance in JavaScript besides just perception of how fast the code runs?</p>

                                        </div>
                                        <div class="post-taglist">
                                            <a href="/questions/tagged/javascript" class="post-tag" title="show questions tagged &#39;javascript&#39;" rel="tag">javascript</a> <a href="/questions/tagged/performance" class="post-tag" title="show questions tagged &#39;performance&#39;" rel="tag">performance</a>
                                        </div>
                                        <table class="fw">
                                            <tr>
                                                <td class="vt">
                                                    <div class="post-menu"><a href="/q/111368" title="short permalink to this question" class="short-link" id="link-post-111368">share</a><span class="lsep">|</span><a href="/posts/111368/edit" class="suggest-edit-post" title="">improve this question</a></div>
                                                </td>
                                                <td align="right" class="post-signature">
                                                    <div class="user-info user-hover">
                                                        <div class="user-action-time">
                                                            <a href="/posts/111368/revisions" title="show all edits to this post">edited <span title="2009-12-10 20:03:58Z" class="relativetime">Dec 10 '09 at 20:03</span></a>
                                                        </div>
                                                        <div class="user-gravatar32">
                                                            <a href="/users/63550/peter-mortensen"><div class="gravatar-wrapper-32"><img src="http://i.stack.imgur.com/RIZKi.png?s=32&g=1" alt=""></div></a>
                                                        </div>
                                                        <div class="user-details">
                                                            <a href="/users/63550/peter-mortensen">Peter Mortensen</a><br>
                                                            <span class="reputation-score" title="reputation score " dir="ltr">7,298</span><span title="8 gold badges"><span class="badge1"></span><span class="badgecount">8</span></span><span title="50 silver badges"><span class="badge2"></span><span class="badgecount">50</span></span><span title="82 bronze badges"><span class="badge3"></span><span class="badgecount">82</span></span>
                                                        </div>
                                                    </div>
                                                </td>
                                                <td class="post-signature owner">
                                                    <div class="user-info user-hover">
                                                        <div class="user-action-time">
                                                            asked <span title="2008-09-21 16:35:58Z" class="relativetime">Sep 21 '08 at 16:35</span>
                                                        </div>
                                                        <div class="user-gravatar32">
                                                            <a href="/users/10352/danmine"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/e769130d93ac58cabb6cc4aecbb247de?s=32&d=identicon&r=PG" alt=""></div></a>
                                                        </div>
                                                        <div class="user-details">
                                                            <a href="/users/10352/danmine">danmine</a><br>
                                                            <span class="reputation-score" title="reputation score " dir="ltr">2,794</span><span title="8 gold badges"><span class="badge1"></span><span class="badgecount">8</span></span><span title="32 silver badges"><span class="badge2"></span><span class="badgecount">32</span></span><span title="59 bronze badges"><span class="badge3"></span><span class="badgecount">59</span></span>
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </div>
                                </td>
                            </tr>

                            <tr>
                                <td class="votecell"></td>
                                <td>
                                    <div id="comments-111368" class="comments " data-localized="true">
                                        <table>
                                            <tbody data-remaining-comments-count="0"
                                                   data-addlink-html="add comment"
                                                   data-addlink-disabled="true">

                                                <tr id="comment-17035663" class="comment ">
                                                    <td>
                                                        <table>
                                                            <tbody>
                                                                <tr>
                                                                    <td class=" comment-score">
                                                                        &nbsp;&nbsp;
                                                                    </td>
                                                                    <td>
                                                                        &nbsp;
                                                                    </td>
                                                                </tr>
                                                            </tbody>
                                                        </table>
                                                    </td>
                                                    <td class="comment-text">
                                                        <div style="display: block;" class="comment-body">
                                                            <span class="comment-copy">You might like to look at the <a href="http://developer.yahoo.com/yslow/" rel="nofollow">YSlow</a> plugin for Firefox.</span>
                                                            &ndash;&nbsp;
                                                            <a href="/users/2974/rob-wells"
                                                               title="21472 reputation"
                                                               class="comment-user">Rob Wells</a>
                                                            <span class="comment-date" dir="ltr"><span title="2008-09-21 16:43:31Z" class="relativetime-clean">Sep 21 '08 at 16:43</span></span>
                                                        </div>
                                                    </td>
                                                </tr>
                                                <tr id="comment-17035664" class="comment ">
                                                    <td class="comment-actions">
                                                        <table>
                                                            <tbody>
                                                                <tr>
                                                                    <td class=" comment-score">
                                                                        <span title="number of &#39;useful comment&#39; votes received"
                                                                              class="cool">3</span>
                                                                    </td>
                                                                    <td>
                                                                        &nbsp;
                                                                    </td>
                                                                </tr>
                                                            </tbody>
                                                        </table>
                                                    </td>
                                                    <td class="comment-text">
                                                        <div style="display: block;" class="comment-body">
                                                            <span class="comment-copy">That&#39;s only going to tell you how long it takes to load. I think the question was more concerned with performance when it is running.</span>
                                                            &ndash;&nbsp;
                                                            <a href="/users/2541/sam-hasler"
                                                               title="10155 reputation"
                                                               class="comment-user">Sam Hasler</a>
                                                            <span class="comment-date" dir="ltr"><span title="2008-09-24 01:18:02Z" class="relativetime-clean">Sep 24 '08 at 1:18</span></span>
                                                        </div>
                                                    </td>
                                                </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                    <a id="comments-link-111368" data-rep=50 data-anon=true
                                       class="comments-link disabled-link"
                                       title="Use comments to ask for more information or suggest improvements. Avoid answering questions in comments.">add comment</a>
                                </td>
                            </tr>
                        </table>
                    </div>


                    <div id="answers">

                        <a name="tab-top"></a>
                        <div id="answers-header">
                            <div class="subheader answers-subheader">
                                <h2>
                                    15 Answers
                                </h2>
                                <div>
                                    <div id="tabs">
                                        <a href="/questions/111368/how-do-you-performance-test-javascript-code?answertab=active#tab-top" title="Answers with the latest activity first">active</a>
                                        <a href="/questions/111368/how-do-you-performance-test-javascript-code?answertab=oldest#tab-top" title="Answers in the order they were provided">oldest</a>
                                        <a class="youarehere" href="/questions/111368/how-do-you-performance-test-javascript-code?answertab=votes#tab-top" title="Answers with the highest score first">votes</a>
                                    </div>
                                </div>
                            </div>
                        </div>





                        <a name="111729"></a>
                        <div id="answer-111729" class="answer" data-answerid="111729">
                            <table>
                                <tr>
                                    <td class="votecell">


                                        <div class="vote">
                                            <input type="hidden" name="_id_" value="111729">
                                            <a class="vote-up-off" title="This answer is useful">up vote</a>
                                            <span class="vote-count-post ">98</span>
                                            <a class="vote-down-off" title="This answer is not useful">down vote</a>



                                        </div>

                                    </td>



                                    <td class="answercell">
                                        <div class="post-text">
                                            <p>Profilers are definitely a good way to get numbers, but in my experience, perceived performance is all that matters to the user/client. For example, we had a project with an Ext accordion that expanded to show some data and then a few nested Ext grids.  Everything was actually rendering pretty fast, no single operation took a long time, there was just a lot of information being rendered all at once, so it felt slow to the user.  </p>

                                            <p>We 'fixed' this, not by switching to a faster component, or optimizing some method, but by rendering the data first, then rendering the grids with a setTimeout. So, the information appeared first, then the grids would pop into place a second later. Overall, it took slightly more processing time to do it that way, but to the user, the perceived performance was improved.</p>

                                        </div>
                                        <table class="fw">
                                            <tr>
                                                <td class="vt">
                                                    <div class="post-menu"><a href="/a/111729" title="short permalink to this answer" class="short-link" id="link-post-111729">share</a><span class="lsep">|</span><a href="/posts/111729/edit" class="suggest-edit-post" title="">improve this answer</a></div>
                                                </td>



                                                <td align="right" class="post-signature">


                                                    <div class="user-info user-hover">
                                                        <div class="user-action-time">
                                                            answered <span title="2008-09-21 18:55:21Z" class="relativetime">Sep 21 '08 at 18:55</span>
                                                        </div>
                                                        <div class="user-gravatar32">
                                                            <a href="/users/12034/noah"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/755ad21d2059ac3970754edd621ba65b?s=32&d=identicon&r=PG" alt=""></div></a>
                                                        </div>
                                                        <div class="user-details">
                                                            <a href="/users/12034/noah">noah</a><br>
                                                            <span class="reputation-score" title="reputation score " dir="ltr">9,155</span><span title="4 gold badges"><span class="badge1"></span><span class="badgecount">4</span></span><span title="30 silver badges"><span class="badge2"></span><span class="badgecount">30</span></span><span title="56 bronze badges"><span class="badge3"></span><span class="badgecount">56</span></span>
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>

                                <tr>
                                    <td class="votecell"></td>
                                    <td>
                                        <div id="comments-111729" class="comments " data-localized="true">
                                            <table>
                                                <tbody data-remaining-comments-count="0"
                                                       data-addlink-html="add comment"
                                                       data-addlink-disabled="true">

                                                    <tr id="comment-1784380" class="comment ">
                                                        <td class="comment-actions">
                                                            <table>
                                                                <tbody>
                                                                    <tr>
                                                                        <td class=" comment-score">
                                                                            <span title="number of &#39;useful comment&#39; votes received"
                                                                                  class="warm">12</span>
                                                                        </td>
                                                                        <td>
                                                                            &nbsp;
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </td>
                                                        <td class="comment-text">
                                                            <div style="display: block;" class="comment-body">
                                                                <span class="comment-copy">yes yes yes. I wish I could mod you up 2x ++1</span>
                                                                &ndash;&nbsp;
                                                                <a href="/users/42304/byron-whitlock"
                                                                   title="29453 reputation"
                                                                   class="comment-user">Byron Whitlock</a>
                                                                <span class="comment-date" dir="ltr"><span title="2009-12-10 21:31:40Z" class="relativetime-clean">Dec 10 '09 at 21:31</span></span>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                        <a id="comments-link-111729" data-rep=50 data-anon=true
                                           class="comments-link disabled-link"
                                           title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add comment</a>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        
                            var ados = ados || {}; ados.run = ados.run || [];
                            ados.run.push(function () { ados_add_placement(22, 8277, "adzerk1908824084", 4).setZone(44); });
                       
                        <div class="everyonelovesstackoverflow" id="adzerk1908824084">
                        </div>

                        <a name="2550811"></a>
                        <div id="answer-2550811" class="answer" data-answerid="2550811">
                            <table>
                                <tr>
                                    <td class="votecell">


                                        <div class="vote">
                                            <input type="hidden" name="_id_" value="2550811">
                                            <a class="vote-up-off" title="This answer is useful">up vote</a>
                                            <span class="vote-count-post ">44</span>
                                            <a class="vote-down-off" title="This answer is not useful">down vote</a>



                                        </div>

                                    </td>



                                    <td class="answercell">
                                        <div class="post-text">
                                            <p>We can always <strong>measure time taken by any function by simple date object</strong>.</p>

<pre><code>var start = +new Date();  // log start timestamp
function1();
var end =  +new Date();  // log end timestamp
var diff = end - start;
</code></pre>

                                        </div>
                                        <table class="fw">
                                            <tr>
                                                <td class="vt">
                                                    <div class="post-menu"><a href="/a/2550811" title="short permalink to this answer" class="short-link" id="link-post-2550811">share</a><span class="lsep">|</span><a href="/posts/2550811/edit" class="suggest-edit-post" title="">improve this answer</a></div>
                                                </td>



                                                <td align="right" class="post-signature">


                                                    <div class="user-info ">
                                                        <div class="user-action-time">
                                                            answered <span title="2010-03-31 06:01:31Z" class="relativetime">Mar 31 '10 at 6:01</span>
                                                        </div>
                                                        <div class="user-gravatar32">
                                                            <a href="/users/40614/pramodc84"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/de60a5fa9b195937c7c94b1804128d1a?s=32&d=identicon&r=PG" alt=""></div></a>
                                                        </div>
                                                        <div class="user-details">
                                                            <a href="/users/40614/pramodc84">pramodc84</a><br>
                                                            <span class="reputation-score" title="reputation score " dir="ltr">788</span><span title="18 silver badges"><span class="badge2"></span><span class="badgecount">18</span></span><span title="26 bronze badges"><span class="badge3"></span><span class="badgecount">26</span></span>
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>

                                <tr>
                                    <td class="votecell"></td>
                                    <td>
                                        <div id="comments-2550811" class="comments " data-localized="true">
                                            <table>
                                                <tbody data-remaining-comments-count="0"
                                                       data-addlink-html="add comment"
                                                       data-addlink-disabled="true">

                                                    <tr id="comment-20540315" class="comment ">
                                                        <td class="comment-actions">
                                                            <table>
                                                                <tbody>
                                                                    <tr>
                                                                        <td class=" comment-score">
                                                                            <span title="number of &#39;useful comment&#39; votes received"
                                                                                  class="warm">6</span>
                                                                        </td>
                                                                        <td>
                                                                            &nbsp;
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </td>
                                                        <td class="comment-text">
                                                            <div style="display: block;" class="comment-body">
                                                                <span class="comment-copy">Note that this solution returns the diff in milliseconds</span>
                                                                &ndash;&nbsp;
                                                                <a href="/users/84292/chris-b"
                                                                   title="3854 reputation"
                                                                   class="comment-user">Chris B</a>
                                                                <span class="comment-date" dir="ltr"><span title="2013-02-04 15:43:58Z" class="relativetime-clean">Feb 4 '13 at 15:43</span></span>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr id="comment-26404685" class="comment ">
                                                        <td class="comment-actions">
                                                            <table>
                                                                <tbody>
                                                                    <tr>
                                                                        <td class=" comment-score">
                                                                            <span title="number of &#39;useful comment&#39; votes received"
                                                                                  class="warm">5</span>
                                                                        </td>
                                                                        <td>
                                                                            &nbsp;
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </td>
                                                        <td class="comment-text">
                                                            <div style="display: block;" class="comment-body">
                                                                <span class="comment-copy">Using Date() is discouraged since the time in milliseconds can vary depending on system factors. Instead use console.time() and console.timeEnd(). See answer by JQuery Lover for more details.</span>
                                                                &ndash;&nbsp;
                                                                <a href="/users/1672318/mbokil"
                                                                   title="486 reputation"
                                                                   class="comment-user">mbokil</a>
                                                                <span class="comment-date" dir="ltr"><span title="2013-08-04 21:22:21Z" class="relativetime-clean">Aug 4 '13 at 21:22</span></span>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr id="comment-36384525" class="comment ">
                                                        <td>
                                                            <table>
                                                                <tbody>
                                                                    <tr>
                                                                        <td class=" comment-score">
                                                                            &nbsp;&nbsp;
                                                                        </td>
                                                                        <td>
                                                                            &nbsp;
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </td>
                                                        <td class="comment-text">
                                                            <div style="display: block;" class="comment-body">
                                                                <span class="comment-copy">Even better, use <a href="https://developer.mozilla.org/en-US/docs/Web/API/Performance.now()" rel="nofollow"><code>performance.now()</code></a></span>
                                                                &ndash;&nbsp;
                                                                <a href="/users/830030/edan"
                                                                   title="386 reputation"
                                                                   class="comment-user">edan</a>
                                                                <span class="comment-date" dir="ltr"><span title="2014-05-15 15:00:32Z" class="relativetime-clean">May 15 at 15:00</span></span>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                        <a id="comments-link-2550811" data-rep=50 data-anon=true
                                           class="comments-link disabled-link"
                                           title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add comment</a>
                                    </td>
                                </tr>
                            </table>
                        </div>


                        <a name="4971482"></a>
                        <div id="answer-4971482" class="answer" data-answerid="4971482">
                            <table>
                                <tr>
                                    <td class="votecell">


                                        <div class="vote">
                                            <input type="hidden" name="_id_" value="4971482">
                                            <a class="vote-up-off" title="This answer is useful">up vote</a>
                                            <span class="vote-count-post ">34</span>
                                            <a class="vote-down-off" title="This answer is not useful">down vote</a>



                                        </div>

                                    </td>



                                    <td class="answercell">
                                        <div class="post-text">
                                            <p>Try <a href="http://jsperf.com">jsPerf</a>. It's an online javascript performance tool for benchmarking and comparing snippets of code. I use it all the time.</p>

                                        </div>
                                        <table class="fw">
                                            <tr>
                                                <td class="vt">
                                                    <div class="post-menu"><a href="/a/4971482" title="short permalink to this answer" class="short-link" id="link-post-4971482">share</a><span class="lsep">|</span><a href="/posts/4971482/edit" class="suggest-edit-post" title="">improve this answer</a></div>
                                                </td>



                                                <td align="right" class="post-signature">


                                                    <div class="user-info ">
                                                        <div class="user-action-time">
                                                            answered <span title="2011-02-11 16:25:43Z" class="relativetime">Feb 11 '11 at 16:25</span>
                                                        </div>
                                                        <div class="user-gravatar32">
                                                            <a href="/users/292955/relax"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/6d5250f50e82bbc8c3daede117b3d031?s=32&d=identicon&r=PG" alt=""></div></a>
                                                        </div>
                                                        <div class="user-details">
                                                            <a href="/users/292955/relax">Relax</a><br>
                                                            <span class="reputation-score" title="reputation score " dir="ltr">563</span><span title="4 silver badges"><span class="badge2"></span><span class="badgecount">4</span></span><span title="7 bronze badges"><span class="badge3"></span><span class="badgecount">7</span></span>
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>

                                <tr>
                                    <td class="votecell"></td>
                                    <td>
                                        <div id="comments-4971482" class="comments " data-localized="true">
                                            <table>
                                                <tbody data-remaining-comments-count="0"
                                                       data-addlink-html="add comment"
                                                       data-addlink-disabled="true">

                                                    <tr id="comment-28804032" class="comment ">
                                                        <td>
                                                            <table>
                                                                <tbody>
                                                                    <tr>
                                                                        <td class=" comment-score">
                                                                            &nbsp;&nbsp;
                                                                        </td>
                                                                        <td>
                                                                            &nbsp;
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </td>
                                                        <td class="comment-text">
                                                            <div style="display: block;" class="comment-body">
                                                                <span class="comment-copy">jsPerf is built upon <a href="https://github.com/bestiejs/benchmark.js" rel="nofollow">github.com/bestiejs/benchmark.js</a></span>
                                                                &ndash;&nbsp;
                                                                <a href="/users/1185957/dannyfritz"
                                                                   title="98 reputation"
                                                                   class="comment-user">dannyfritz</a>
                                                                <span class="comment-date" dir="ltr"><span title="2013-10-17 14:10:57Z" class="relativetime-clean">Oct 17 '13 at 14:10</span></span>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                        <a id="comments-link-4971482" data-rep=50 data-anon=true
                                           class="comments-link disabled-link"
                                           title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add comment</a>
                                    </td>
                                </tr>
                            </table>
                        </div>


                        <a name="4188925"></a>
                        <div id="answer-4188925" class="answer" data-answerid="4188925">
                            <table>
                                <tr>
                                    <td class="votecell">


                                        <div class="vote">
                                            <input type="hidden" name="_id_" value="4188925">
                                            <a class="vote-up-off" title="This answer is useful">up vote</a>
                                            <span class="vote-count-post ">25</span>
                                            <a class="vote-down-off" title="This answer is not useful">down vote</a>



                                        </div>

                                    </td>



                                    <td class="answercell">
                                        <div class="post-text">
                                            <p><a href="http://code.google.com/p/jslitmus/">JSLitmus</a> is a lightweight tool for creating ad-hoc JavaScript benchmark tests</p>

                                            <p>Let examine the performance between <code>function expression</code> and <code>function constructor</code>:</p>

<pre><code>&lt;script src="JSLitmus.js"&gt;&lt;/script&gt;
&lt;script&gt;
JSLitmus.test("new Function ... ", function() { 
    return new Function("for(var i=0; i&lt;100; i++) {}"); 
});
JSLitmus.test("function() ...", function() { 
       return (function() { for(var i=0; i&lt;100; i++) {}  });
});
&lt;/script&gt;
</code></pre>

                                            <p>What I did above is create a <code>function expression</code> and <code>function constructor</code> performing same operation. The result is as follows:</p>

                                            <p><strong>FireFox Performance Result</strong></p>

                                            <p><img src="http://i.stack.imgur.com/Oi4Wl.png" alt="FireFox Performance Result"></p>

                                            <p><strong>IE Performance Result</strong></p>

                                            <p><img src="http://i.stack.imgur.com/7XCCD.png" alt="IE Performance Result"></p>

                                        </div>
                                        <table class="fw">
                                            <tr>
                                                <td class="vt">
                                                    <div class="post-menu"><a href="/a/4188925" title="short permalink to this answer" class="short-link" id="link-post-4188925">share</a><span class="lsep">|</span><a href="/posts/4188925/edit" class="suggest-edit-post" title="">improve this answer</a></div>
                                                </td>
                                                <td align="right" class="post-signature">
                                                    <div class="user-info user-hover">
                                                        <div class="user-action-time">
                                                            <a href="/posts/4188925/revisions" title="show all edits to this post">edited <span title="2012-08-03 03:29:53Z" class="relativetime">Aug 3 '12 at 3:29</span></a>
                                                        </div>
                                                        <div class="user-gravatar32">
                                                            <a href="/users/364198/farray"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/f94ba46f513ebd69717a83890dc8686c?s=32&d=identicon&r=PG" alt=""></div></a>
                                                        </div>
                                                        <div class="user-details">
                                                            <a href="/users/364198/farray">Farray</a><br>
                                                            <span class="reputation-score" title="reputation score " dir="ltr">3,598</span><span title="1 gold badge"><span class="badge1"></span><span class="badgecount">1</span></span><span title="12 silver badges"><span class="badge2"></span><span class="badgecount">12</span></span><span title="24 bronze badges"><span class="badge3"></span><span class="badgecount">24</span></span>
                                                        </div>
                                                    </div>
                                                </td>



                                                <td align="right" class="post-signature">


                                                    <div class="user-info ">
                                                        <div class="user-action-time">
                                                            answered <span title="2010-11-15 21:20:32Z" class="relativetime">Nov 15 '10 at 21:20</span>
                                                        </div>
                                                        <div class="user-gravatar32">
                                                            <a href="/users/134743/ramiz-uddin"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/06a9b12081a0e2c55a44794a489976ce?s=32&d=identicon&r=PG" alt=""></div></a>
                                                        </div>
                                                        <div class="user-details">
                                                            <a href="/users/134743/ramiz-uddin">Ramiz Uddin</a><br>
                                                            <span class="reputation-score" title="reputation score " dir="ltr">2,604</span><span title="4 gold badges"><span class="badge1"></span><span class="badgecount">4</span></span><span title="25 silver badges"><span class="badge2"></span><span class="badgecount">25</span></span><span title="57 bronze badges"><span class="badge3"></span><span class="badgecount">57</span></span>
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>

                                <tr>
                                    <td class="votecell"></td>
                                    <td>
                                        <div id="comments-4188925" class="comments " data-localized="true">
                                            <table>
                                                <tbody data-remaining-comments-count="0"
                                                       data-addlink-html="add comment"
                                                       data-addlink-disabled="true">

                                                    <tr id="comment-15675105" class="comment ">
                                                        <td>
                                                            <table>
                                                                <tbody>
                                                                    <tr>
                                                                        <td class=" comment-score">
                                                                            &nbsp;&nbsp;
                                                                        </td>
                                                                        <td>
                                                                            &nbsp;
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </td>
                                                        <td class="comment-text">
                                                            <div style="display: block;" class="comment-body">
                                                                <span class="comment-copy">The linked JSLitmus page contains broken download links. I&#39;ve found <a href="http://code.google.com/p/pmrpc/source/browse/trunk/benchmark/JSLitmus.js?r=219" rel="nofollow">JSLitmus</a> (for browsers) and <a href="https://github.com/broofa/jslitmus" rel="nofollow">jslitmus</a> (for NodeJS, lowercase!).</span>
                                                                &ndash;&nbsp;
                                                                <a href="/users/938089/rob-w"
                                                                   title="120151 reputation"
                                                                   class="comment-user">Rob W</a>
                                                                <span class="comment-date" dir="ltr"><span title="2012-08-03 14:31:56Z" class="relativetime-clean">Aug 3 '12 at 14:31</span></span>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                        <a id="comments-link-4188925" data-rep=50 data-anon=true
                                           class="comments-link disabled-link"
                                           title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add comment</a>
                                    </td>
                                </tr>
                            </table>
                        </div>


                        <a name="17943511"></a>
                        <div id="answer-17943511" class="answer" data-answerid="17943511">
                            <table>
                                <tr>
                                    <td class="votecell">


                                        <div class="vote">
                                            <input type="hidden" name="_id_" value="17943511">
                                            <a class="vote-up-off" title="This answer is useful">up vote</a>
                                            <span class="vote-count-post ">24</span>
                                            <a class="vote-down-off" title="This answer is not useful">down vote</a>



                                        </div>

                                    </td>



                                    <td class="answercell">
                                        <div class="post-text">
                                            <p>I do agree that perceived performance is really all that matters. But sometimes I just want to find out which method of doing something is faster. Sometimes the difference is HUGE and worth knowing.</p>

                                            <p>You could just use javascript timers. But I typically get much more consistent results using the native Chrome (also in FF) devTool methods <code>console.time()</code> &amp; <code>console.timeEnd()</code></p>

                                            <p>Example of how I use it:</p>

<pre><code>var iterations = 1000000;
console.time('Function #1');
for(var i = 0; i &lt; iterations; i++ ){
    functionOne();
};
console.timeEnd('Function #1')
console.time('Function #2');
for(var i = 0; i &lt; iterations; i++ ){
    functionTwo();
};
console.timeEnd('Function #2')
</code></pre>

                                            <p><img src="http://i.stack.imgur.com/IVo6d.png" alt="Results Look like this"></p>

                                        </div>
                                        <table class="fw">
                                            <tr>
                                                <td class="vt">
                                                    <div class="post-menu"><a href="/a/17943511" title="short permalink to this answer" class="short-link" id="link-post-17943511">share</a><span class="lsep">|</span><a href="/posts/17943511/edit" class="suggest-edit-post" title="">improve this answer</a></div>
                                                </td>



                                                <td align="right" class="post-signature">


                                                    <div class="user-info ">
                                                        <div class="user-action-time">
                                                            answered <span title="2013-07-30 09:41:33Z" class="relativetime">Jul 30 '13 at 9:41</span>
                                                        </div>
                                                        <div class="user-gravatar32">
                                                            <a href="/users/831738/jose-browne"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/529fcc5c60a48b97002ec21bd6f668e6?s=32&d=identicon&r=PG" alt=""></div></a>
                                                        </div>
                                                        <div class="user-details">
                                                            <a href="/users/831738/jose-browne">Jose Browne</a><br>
                                                            <span class="reputation-score" title="reputation score " dir="ltr">968</span><span title="7 silver badges"><span class="badge2"></span><span class="badgecount">7</span></span><span title="16 bronze badges"><span class="badge3"></span><span class="badgecount">16</span></span>
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>

                                <tr>
                                    <td class="votecell"></td>
                                    <td>
                                        <div id="comments-17943511" class="comments " data-localized="true">
                                            <table>
                                                <tbody data-remaining-comments-count="0"
                                                       data-addlink-html="add comment"
                                                       data-addlink-disabled="true">

                                                    <tr id="comment-32735527" class="comment ">
                                                        <td>
                                                            <table>
                                                                <tbody>
                                                                    <tr>
                                                                        <td class=" comment-score">
                                                                            &nbsp;&nbsp;
                                                                        </td>
                                                                        <td>
                                                                            &nbsp;
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </td>
                                                        <td class="comment-text">
                                                            <div style="display: block;" class="comment-body">
                                                                <span class="comment-copy">Yes, one of the charms with this one is that it&#39;s fast n easy to implement. I wonder, will the logging per se take some of the performance from the javascript execution. Let&#39;s say that we have a loop in a game and it outputs multiple log rows. For example once per second for 5 minutes, that is 300 rows. Anyone knows?</span>
                                                                &ndash;&nbsp;
                                                                <a href="/users/1781318/kilian-lindberg"
                                                                   title="409 reputation"
                                                                   class="comment-user">Kilian Lindberg</a>
                                                                <span class="comment-date" dir="ltr"><span title="2014-02-09 11:37:20Z" class="relativetime-clean">Feb 9 at 11:37</span></span>
                                                                <span class="edited-yes" title="this comment was edited 1 time"></span>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                        <a id="comments-link-17943511" data-rep=50 data-anon=true
                                           class="comments-link disabled-link"
                                           title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add comment</a>
                                    </td>
                                </tr>
                            </table>
                        </div>


                        <a name="111397"></a>
                        <div id="answer-111397" class="answer" data-answerid="111397">
                            <table>
                                <tr>
                                    <td class="votecell">


                                        <div class="vote">
                                            <input type="hidden" name="_id_" value="111397">
                                            <a class="vote-up-off" title="This answer is useful">up vote</a>
                                            <span class="vote-count-post ">13</span>
                                            <a class="vote-down-off" title="This answer is not useful">down vote</a>



                                        </div>

                                    </td>



                                    <td class="answercell">
                                        <div class="post-text">
                                            <p>Some people are suggesting specific plug-ins and/or browsers. I would not because they're only <em>really</em> useful for that one platform; a test run on Firefox will not translate accurately to IE7. Considering 99.999999% of sites have more than one browser visit them, <strong>you need to check performance on all the popular platforms.</strong></p>

                                            <p>My suggestion would be to keep this in the JS. Create a benchmarking page with all your JS test on and time the execution. You could even have it AJAX-post the results back to you to keep it fully automated.</p>

                                            <p>Then just rinse and repeat over different platforms.</p>

                                        </div>
                                        <table class="fw">
                                            <tr>
                                                <td class="vt">
                                                    <div class="post-menu"><a href="/a/111397" title="short permalink to this answer" class="short-link" id="link-post-111397">share</a><span class="lsep">|</span><a href="/posts/111397/edit" class="suggest-edit-post" title="">improve this answer</a></div>
                                                </td>
                                                <td align="right" class="post-signature">
                                                    <div class="user-info ">
                                                        <div class="user-action-time">
                                                            <a href="/posts/111397/revisions" title="show all edits to this post">edited <span title="2008-09-21 16:57:00Z" class="relativetime">Sep 21 '08 at 16:57</span></a>
                                                        </div>
                                                        <div class="user-gravatar32">

                                                        </div>
                                                        <div class="user-details">
                                                            <br>

                                                        </div>
                                                    </div>
                                                </td>



                                                <td align="right" class="post-signature">


                                                    <div class="user-info user-hover">
                                                        <div class="user-action-time">
                                                            answered <span title="2008-09-21 16:50:03Z" class="relativetime">Sep 21 '08 at 16:50</span>
                                                        </div>
                                                        <div class="user-gravatar32">
                                                            <a href="/users/12870/oli"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/f0af40756420859b5b63cbceb6d30505?s=32&d=identicon&r=PG" alt=""></div></a>
                                                        </div>
                                                        <div class="user-details">
                                                            <a href="/users/12870/oli">Oli</a><br>
                                                            <span class="reputation-score" title="reputation score 63134" dir="ltr">63.1k</span><span title="24 gold badges"><span class="badge1"></span><span class="badgecount">24</span></span><span title="129 silver badges"><span class="badge2"></span><span class="badgecount">129</span></span><span title="185 bronze badges"><span class="badge3"></span><span class="badgecount">185</span></span>
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>

                                <tr>
                                    <td class="votecell"></td>
                                    <td>
                                        <div id="comments-111397" class="comments " data-localized="true">
                                            <table>
                                                <tbody data-remaining-comments-count="0"
                                                       data-addlink-html="add comment"
                                                       data-addlink-disabled="true">

                                                    <tr id="comment-21852" class="comment ">
                                                        <td class="comment-actions">
                                                            <table>
                                                                <tbody>
                                                                    <tr>
                                                                        <td class=" comment-score">
                                                                            <span title="number of &#39;useful comment&#39; votes received"
                                                                                  class="cool">2</span>
                                                                        </td>
                                                                        <td>
                                                                            &nbsp;
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </td>
                                                        <td class="comment-text">
                                                            <div style="display: block;" class="comment-body">
                                                                <span class="comment-copy">this is true, but profilers are good in case there is a coding problem that has nothing to do with a browser specific issue.</span>
                                                                &ndash;&nbsp;
                                                                <a href="/users/2847/john-boker"
                                                                   title="35521 reputation"
                                                                   class="comment-user">John Boker</a>
                                                                <span class="comment-date" dir="ltr"><span title="2008-09-21 17:02:48Z" class="relativetime-clean">Sep 21 '08 at 17:02</span></span>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr id="comment-21993" class="comment ">
                                                        <td>
                                                            <table>
                                                                <tbody>
                                                                    <tr>
                                                                        <td class=" comment-score">
                                                                            &nbsp;&nbsp;
                                                                        </td>
                                                                        <td>
                                                                            &nbsp;
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </td>
                                                        <td class="comment-text">
                                                            <div style="display: block;" class="comment-body">
                                                                <span class="comment-copy">Sure! Yeah they&#39;ll catch general &quot;bad coding&quot; problems and specific ones are great for doing the actual debugging, but for general use-case testing, you&#39;ll benefit from something that runs on all platforms.</span>
                                                                &ndash;&nbsp;
                                                                <a href="/users/12870/oli"
                                                                   title="63134 reputation"
                                                                   class="comment-user">Oli</a>
                                                                <span class="comment-date" dir="ltr"><span title="2008-09-21 19:02:29Z" class="relativetime-clean">Sep 21 '08 at 19:02</span></span>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr id="comment-1784319" class="comment ">
                                                        <td class="comment-actions">
                                                            <table>
                                                                <tbody>
                                                                    <tr>
                                                                        <td class=" comment-score">
                                                                            <span title="number of &#39;useful comment&#39; votes received"
                                                                                  class="cool">1</span>
                                                                        </td>
                                                                        <td>
                                                                            &nbsp;
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </td>
                                                        <td class="comment-text">
                                                            <div style="display: block;" class="comment-body">
                                                                <span class="comment-copy">+1 on the note that this is true, but having a profiler like Firebug is still great, if not essential, to find bottlenecks.</span>
                                                                &ndash;&nbsp;
                                                                <a href="/users/187606/pekka"
                                                                   title="245710 reputation"
                                                                   class="comment-user">Pekka 웃</a>
                                                                <span class="comment-date" dir="ltr"><span title="2009-12-10 21:23:54Z" class="relativetime-clean">Dec 10 '09 at 21:23</span></span>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                        <a id="comments-link-111397" data-rep=50 data-anon=true
                                           class="comments-link disabled-link"
                                           title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add comment</a>
                                    </td>
                                </tr>
                            </table>
                        </div>


                        <a name="111396"></a>
                        <div id="answer-111396" class="answer" data-answerid="111396">
                            <table>
                                <tr>
                                    <td class="votecell">


                                        <div class="vote">
                                            <input type="hidden" name="_id_" value="111396">
                                            <a class="vote-up-off" title="This answer is useful">up vote</a>
                                            <span class="vote-count-post ">5</span>
                                            <a class="vote-down-off" title="This answer is not useful">down vote</a>



                                        </div>

                                    </td>



                                    <td class="answercell">
                                        <div class="post-text">
                                            <p>You could use this: <a href="http://getfirebug.com/js.html" rel="nofollow">http://getfirebug.com/js.html</a>. It has a profiler for JavaScript.</p>

                                        </div>
                                        <table class="fw">
                                            <tr>
                                                <td class="vt">
                                                    <div class="post-menu"><a href="/a/111396" title="short permalink to this answer" class="short-link" id="link-post-111396">share</a><span class="lsep">|</span><a href="/posts/111396/edit" class="suggest-edit-post" title="">improve this answer</a></div>
                                                </td>
                                                <td align="right" class="post-signature">
                                                    <div class="user-info user-hover">
                                                        <div class="user-action-time">
                                                            <a href="/posts/111396/revisions" title="show all edits to this post">edited <span title="2009-12-10 21:22:50Z" class="relativetime">Dec 10 '09 at 21:22</span></a>
                                                        </div>
                                                        <div class="user-gravatar32">
                                                            <a href="/users/63550/peter-mortensen"><div class="gravatar-wrapper-32"><img src="http://i.stack.imgur.com/RIZKi.png?s=32&g=1" alt=""></div></a>
                                                        </div>
                                                        <div class="user-details">
                                                            <a href="/users/63550/peter-mortensen">Peter Mortensen</a><br>
                                                            <span class="reputation-score" title="reputation score " dir="ltr">7,298</span><span title="8 gold badges"><span class="badge1"></span><span class="badgecount">8</span></span><span title="50 silver badges"><span class="badge2"></span><span class="badgecount">50</span></span><span title="82 bronze badges"><span class="badge3"></span><span class="badgecount">82</span></span>
                                                        </div>
                                                    </div>
                                                </td>



                                                <td align="right" class="post-signature">


                                                    <div class="user-info user-hover">
                                                        <div class="user-action-time">
                                                            answered <span title="2008-09-21 16:48:56Z" class="relativetime">Sep 21 '08 at 16:48</span>
                                                        </div>
                                                        <div class="user-gravatar32">
                                                            <a href="/users/2847/john-boker"><div class="gravatar-wrapper-32"><img src="http://i.stack.imgur.com/zNdvw.jpg?s=32&g=1" alt=""></div></a>
                                                        </div>
                                                        <div class="user-details">
                                                            <a href="/users/2847/john-boker">John Boker</a><br>
                                                            <span class="reputation-score" title="reputation score 35521" dir="ltr">35.5k</span><span title="10 gold badges"><span class="badge1"></span><span class="badgecount">10</span></span><span title="50 silver badges"><span class="badge2"></span><span class="badgecount">50</span></span><span title="92 bronze badges"><span class="badge3"></span><span class="badgecount">92</span></span>
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>

                                <tr>
                                    <td class="votecell"></td>
                                    <td>
                                        <div id="comments-111396" class="comments  dno" data-localized="true">
                                            <table>
                                                <tbody data-remaining-comments-count="0"
                                                       data-addlink-html="add comment"
                                                       data-addlink-disabled="true">
                                                    <tr><td></td><td></td></tr>
                                                </tbody>
                                            </table>
                                        </div>
                                        <a id="comments-link-111396" data-rep=50 data-anon=true
                                           class="comments-link disabled-link"
                                           title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add comment</a>
                                    </td>
                                </tr>
                            </table>
                        </div>


                        <a name="10669341"></a>
                        <div id="answer-10669341" class="answer" data-answerid="10669341">
                            <table>
                                <tr>
                                    <td class="votecell">


                                        <div class="vote">
                                            <input type="hidden" name="_id_" value="10669341">
                                            <a class="vote-up-off" title="This answer is useful">up vote</a>
                                            <span class="vote-count-post ">5</span>
                                            <a class="vote-down-off" title="This answer is not useful">down vote</a>



                                        </div>

                                    </td>



                                    <td class="answercell">
                                        <div class="post-text">
                                            <p>Here is a simple function that displays the execution time of a passed in function.</p>

<pre><code>var perf = function (testName, fn) {
  var startTime = new Date().getTime();
  fn();
  var endTime = new Date().getTime();
  console.log(testName + ": " + (endTime - startTime) + "ms");
}
</code></pre>

                                        </div>
                                        <table class="fw">
                                            <tr>
                                                <td class="vt">
                                                    <div class="post-menu"><a href="/a/10669341" title="short permalink to this answer" class="short-link" id="link-post-10669341">share</a><span class="lsep">|</span><a href="/posts/10669341/edit" class="suggest-edit-post" title="">improve this answer</a></div>
                                                </td>



                                                <td align="right" class="post-signature">


                                                    <div class="user-info ">
                                                        <div class="user-action-time">
                                                            answered <span title="2012-05-19 22:38:24Z" class="relativetime">May 19 '12 at 22:38</span>
                                                        </div>
                                                        <div class="user-gravatar32">
                                                            <a href="/users/221435/bunz"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/d1c6269dbbbf06822b6ff9f755635659?s=32&d=identicon&r=PG" alt=""></div></a>
                                                        </div>
                                                        <div class="user-details">
                                                            <a href="/users/221435/bunz">Bunz</a><br>
                                                            <span class="reputation-score" title="reputation score " dir="ltr">138</span><span title="1 silver badge"><span class="badge2"></span><span class="badgecount">1</span></span><span title="5 bronze badges"><span class="badge3"></span><span class="badgecount">5</span></span>
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>

                                <tr>
                                    <td class="votecell"></td>
                                    <td>
                                        <div id="comments-10669341" class="comments  dno" data-localized="true">
                                            <table>
                                                <tbody data-remaining-comments-count="0"
                                                       data-addlink-html="add comment"
                                                       data-addlink-disabled="true">
                                                    <tr><td></td><td></td></tr>
                                                </tbody>
                                            </table>
                                        </div>
                                        <a id="comments-link-10669341" data-rep=50 data-anon=true
                                           class="comments-link disabled-link"
                                           title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add comment</a>
                                    </td>
                                </tr>
                            </table>
                        </div>


                        <a name="393724"></a>
                        <div id="answer-393724" class="answer" data-answerid="393724">
                            <table>
                                <tr>
                                    <td class="votecell">


                                        <div class="vote">
                                            <input type="hidden" name="_id_" value="393724">
                                            <a class="vote-up-off" title="This answer is useful">up vote</a>
                                            <span class="vote-count-post ">3</span>
                                            <a class="vote-down-off" title="This answer is not useful">down vote</a>



                                        </div>

                                    </td>



                                    <td class="answercell">
                                        <div class="post-text">
                                            <p>I think JavaScript performance (time) testing is quite enough. I found a very handy article about <a href="http://jquery-howto.blogspot.com/2008/12/how-to-test-javascript-performance.html" rel="nofollow">JavaScript performance testing here</a>.</p>

                                        </div>
                                        <table class="fw">
                                            <tr>
                                                <td class="vt">
                                                    <div class="post-menu"><a href="/a/393724" title="short permalink to this answer" class="short-link" id="link-post-393724">share</a><span class="lsep">|</span><a href="/posts/393724/edit" class="suggest-edit-post" title="">improve this answer</a></div>
                                                </td>
                                                <td align="right" class="post-signature">
                                                    <div class="user-info user-hover">
                                                        <div class="user-action-time">
                                                            <a href="/posts/393724/revisions" title="show all edits to this post">edited <span title="2009-12-10 21:21:54Z" class="relativetime">Dec 10 '09 at 21:21</span></a>
                                                        </div>
                                                        <div class="user-gravatar32">
                                                            <a href="/users/63550/peter-mortensen"><div class="gravatar-wrapper-32"><img src="http://i.stack.imgur.com/RIZKi.png?s=32&g=1" alt=""></div></a>
                                                        </div>
                                                        <div class="user-details">
                                                            <a href="/users/63550/peter-mortensen">Peter Mortensen</a><br>
                                                            <span class="reputation-score" title="reputation score " dir="ltr">7,298</span><span title="8 gold badges"><span class="badge1"></span><span class="badgecount">8</span></span><span title="50 silver badges"><span class="badge2"></span><span class="badgecount">50</span></span><span title="82 bronze badges"><span class="badge3"></span><span class="badgecount">82</span></span>
                                                        </div>
                                                    </div>
                                                </td>



                                                <td align="right" class="post-signature">


                                                    <div class="user-info ">
                                                        <div class="user-action-time">
                                                            answered <span title="2008-12-26 12:32:39Z" class="relativetime">Dec 26 '08 at 12:32</span>
                                                        </div>
                                                        <div class="user-gravatar32">
                                                            <a href="/users/49200/jquery-lover"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/2d974c6f04064429b8368336a5f41c82?s=32&d=identicon&r=PG" alt=""></div></a>
                                                        </div>
                                                        <div class="user-details">
                                                            <a href="/users/49200/jquery-lover">jQuery Lover</a><br>
                                                            <span class="reputation-score" title="reputation score " dir="ltr">427</span><span title="1 gold badge"><span class="badge1"></span><span class="badgecount">1</span></span><span title="4 silver badges"><span class="badge2"></span><span class="badgecount">4</span></span><span title="6 bronze badges"><span class="badge3"></span><span class="badgecount">6</span></span>
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>

                                <tr>
                                    <td class="votecell"></td>
                                    <td>
                                        <div id="comments-393724" class="comments  dno" data-localized="true">
                                            <table>
                                                <tbody data-remaining-comments-count="0"
                                                       data-addlink-html="add comment"
                                                       data-addlink-disabled="true">
                                                    <tr><td></td><td></td></tr>
                                                </tbody>
                                            </table>
                                        </div>
                                        <a id="comments-link-393724" data-rep=50 data-anon=true
                                           class="comments-link disabled-link"
                                           title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add comment</a>
                                    </td>
                                </tr>
                            </table>
                        </div>


                        <a name="111376"></a>
                        <div id="answer-111376" class="answer" data-answerid="111376">
                            <table>
                                <tr>
                                    <td class="votecell">


                                        <div class="vote">
                                            <input type="hidden" name="_id_" value="111376">
                                            <a class="vote-up-off" title="This answer is useful">up vote</a>
                                            <span class="vote-count-post ">2</span>
                                            <a class="vote-down-off" title="This answer is not useful">down vote</a>



                                        </div>

                                    </td>



                                    <td class="answercell">
                                        <div class="post-text">
                                            <p>I find execution time to be the best measure.</p>

                                        </div>
                                        <table class="fw">
                                            <tr>
                                                <td class="vt">
                                                    <div class="post-menu"><a href="/a/111376" title="short permalink to this answer" class="short-link" id="link-post-111376">share</a><span class="lsep">|</span><a href="/posts/111376/edit" class="suggest-edit-post" title="">improve this answer</a></div>
                                                </td>



                                                <td align="right" class="post-signature">


                                                    <div class="user-info user-hover">
                                                        <div class="user-action-time">
                                                            answered <span title="2008-09-21 16:38:50Z" class="relativetime">Sep 21 '08 at 16:38</span>
                                                        </div>
                                                        <div class="user-gravatar32">
                                                            <a href="/users/7819/pdavis"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/377c8bbea07695b8ac813040a3bfb357?s=32&d=identicon&r=PG" alt=""></div></a>
                                                        </div>
                                                        <div class="user-details">
                                                            <a href="/users/7819/pdavis">pdavis</a><br>
                                                            <span class="reputation-score" title="reputation score " dir="ltr">2,494</span><span title="1 gold badge"><span class="badge1"></span><span class="badgecount">1</span></span><span title="16 silver badges"><span class="badge2"></span><span class="badgecount">16</span></span><span title="25 bronze badges"><span class="badge3"></span><span class="badgecount">25</span></span>
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>

                                <tr>
                                    <td class="votecell"></td>
                                    <td>
                                        <div id="comments-111376" class="comments " data-localized="true">
                                            <table>
                                                <tbody data-remaining-comments-count="0"
                                                       data-addlink-html="add comment"
                                                       data-addlink-disabled="true">

                                                    <tr id="comment-1784323" class="comment ">
                                                        <td>
                                                            <table>
                                                                <tbody>
                                                                    <tr>
                                                                        <td class=" comment-score">
                                                                            &nbsp;&nbsp;
                                                                        </td>
                                                                        <td>
                                                                            &nbsp;
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </td>
                                                        <td class="comment-text">
                                                            <div style="display: block;" class="comment-body">
                                                                <span class="comment-copy">As opposed to what? I&#39;m not sure I understand.</span>
                                                                &ndash;&nbsp;
                                                                <a href="/users/187606/pekka"
                                                                   title="245710 reputation"
                                                                   class="comment-user">Pekka 웃</a>
                                                                <span class="comment-date" dir="ltr"><span title="2009-12-10 21:24:27Z" class="relativetime-clean">Dec 10 '09 at 21:24</span></span>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr id="comment-1784369" class="comment ">
                                                        <td>
                                                            <table>
                                                                <tbody>
                                                                    <tr>
                                                                        <td class=" comment-score">
                                                                            &nbsp;&nbsp;
                                                                        </td>
                                                                        <td>
                                                                            &nbsp;
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </td>
                                                        <td class="comment-text">
                                                            <div style="display: block;" class="comment-body">
                                                                <span class="comment-copy">As opposed to the orignal posters question: &quot;CPU Cycles, Memory Usage, Execution Time, etc.?&quot;</span>
                                                                &ndash;&nbsp;
                                                                <a href="/users/160359/snicker"
                                                                   title="3043 reputation"
                                                                   class="comment-user">snicker</a>
                                                                <span class="comment-date" dir="ltr"><span title="2009-12-10 21:30:37Z" class="relativetime-clean">Dec 10 '09 at 21:30</span></span>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                        <a id="comments-link-111376" data-rep=50 data-anon=true
                                           class="comments-link disabled-link"
                                           title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add comment</a>
                                    </td>
                                </tr>
                            </table>
                        </div>


                        <a name="12262477"></a>
                        <div id="answer-12262477" class="answer" data-answerid="12262477">
                            <table>
                                <tr>
                                    <td class="votecell">


                                        <div class="vote">
                                            <input type="hidden" name="_id_" value="12262477">
                                            <a class="vote-up-off" title="This answer is useful">up vote</a>
                                            <span class="vote-count-post ">2</span>
                                            <a class="vote-down-off" title="This answer is not useful">down vote</a>



                                        </div>

                                    </td>



                                    <td class="answercell">
                                        <div class="post-text">
                                            <p>You could use <a href="http://getfirebug.com/logging" rel="nofollow">console.profile</a> in firebug</p>

                                        </div>
                                        <table class="fw">
                                            <tr>
                                                <td class="vt">
                                                    <div class="post-menu"><a href="/a/12262477" title="short permalink to this answer" class="short-link" id="link-post-12262477">share</a><span class="lsep">|</span><a href="/posts/12262477/edit" class="suggest-edit-post" title="">improve this answer</a></div>
                                                </td>



                                                <td align="right" class="post-signature">


                                                    <div class="user-info ">
                                                        <div class="user-action-time">
                                                            answered <span title="2012-09-04 11:21:57Z" class="relativetime">Sep 4 '12 at 11:21</span>
                                                        </div>
                                                        <div class="user-gravatar32">
                                                            <a href="/users/1474739/willem-de-wit"><div class="gravatar-wrapper-32"><img src="http://i.stack.imgur.com/LUkEQ.jpg?s=32&g=1" alt=""></div></a>
                                                        </div>
                                                        <div class="user-details">
                                                            <a href="/users/1474739/willem-de-wit">Willem de Wit</a><br>
                                                            <span class="reputation-score" title="reputation score " dir="ltr">2,344</span><span title="14 silver badges"><span class="badge2"></span><span class="badgecount">14</span></span><span title="41 bronze badges"><span class="badge3"></span><span class="badgecount">41</span></span>
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>

                                <tr>
                                    <td class="votecell"></td>
                                    <td>
                                        <div id="comments-12262477" class="comments  dno" data-localized="true">
                                            <table>
                                                <tbody data-remaining-comments-count="0"
                                                       data-addlink-html="add comment"
                                                       data-addlink-disabled="true">
                                                    <tr><td></td><td></td></tr>
                                                </tbody>
                                            </table>
                                        </div>
                                        <a id="comments-link-12262477" data-rep=50 data-anon=true
                                           class="comments-link disabled-link"
                                           title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add comment</a>
                                    </td>
                                </tr>
                            </table>
                        </div>


                        <a name="111373"></a>
                        <div id="answer-111373" class="answer" data-answerid="111373">
                            <table>
                                <tr>
                                    <td class="votecell">


                                        <div class="vote">
                                            <input type="hidden" name="_id_" value="111373">
                                            <a class="vote-up-off" title="This answer is useful">up vote</a>
                                            <span class="vote-count-post ">1</span>
                                            <a class="vote-down-off" title="This answer is not useful">down vote</a>



                                        </div>

                                    </td>



                                    <td class="answercell">
                                        <div class="post-text">
                                            <p>Chrome has some good tools built in for this.</p>

                                        </div>
                                        <table class="fw">
                                            <tr>
                                                <td class="vt">
                                                    <div class="post-menu"><a href="/a/111373" title="short permalink to this answer" class="short-link" id="link-post-111373">share</a><span class="lsep">|</span><a href="/posts/111373/edit" class="suggest-edit-post" title="">improve this answer</a></div>
                                                </td>



                                                <td align="right" class="post-signature">


                                                    <div class="user-info user-hover">
                                                        <div class="user-action-time">
                                                            answered <span title="2008-09-21 16:38:17Z" class="relativetime">Sep 21 '08 at 16:38</span>
                                                        </div>
                                                        <div class="user-gravatar32">
                                                            <a href="/users/10906/kevin-conner"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/00ae73d6f56fdd1670b86f5267b92eaa?s=32&d=identicon&r=PG" alt=""></div></a>
                                                        </div>
                                                        <div class="user-details">
                                                            <a href="/users/10906/kevin-conner">Kevin Conner</a><br>
                                                            <span class="reputation-score" title="reputation score " dir="ltr">5,732</span><span title="1 gold badge"><span class="badge1"></span><span class="badgecount">1</span></span><span title="26 silver badges"><span class="badge2"></span><span class="badgecount">26</span></span><span title="41 bronze badges"><span class="badge3"></span><span class="badgecount">41</span></span>
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>

                                <tr>
                                    <td class="votecell"></td>
                                    <td>
                                        <div id="comments-111373" class="comments " data-localized="true">
                                            <table>
                                                <tbody data-remaining-comments-count="0"
                                                       data-addlink-html="add comment"
                                                       data-addlink-disabled="true">

                                                    <tr id="comment-27770751" class="comment ">
                                                        <td>
                                                            <table>
                                                                <tbody>
                                                                    <tr>
                                                                        <td class=" comment-score">
                                                                            &nbsp;&nbsp;
                                                                        </td>
                                                                        <td>
                                                                            &nbsp;
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </td>
                                                        <td class="comment-text">
                                                            <div style="display: block;" class="comment-body">
                                                                <span class="comment-copy">How to access them?</span>
                                                                &ndash;&nbsp;
                                                                <a href="/users/2072569/dalvik-vm"
                                                                   title="86 reputation"
                                                                   class="comment-user">Dalvik VM</a>
                                                                <span class="comment-date" dir="ltr"><span title="2013-09-16 11:25:29Z" class="relativetime-clean">Sep 16 '13 at 11:25</span></span>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr id="comment-31720408" class="comment ">
                                                        <td>
                                                            <table>
                                                                <tbody>
                                                                    <tr>
                                                                        <td class=" comment-score">
                                                                            &nbsp;&nbsp;
                                                                        </td>
                                                                        <td>
                                                                            &nbsp;
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </td>
                                                        <td class="comment-text">
                                                            <div style="display: block;" class="comment-body">
                                                                <span class="comment-copy">Simple, press f12. Go to network tab. Press f5 to refresh your web page and see the magic.</span>
                                                                &ndash;&nbsp;
                                                                <a href="/users/942301/theinsaneone"
                                                                   title="394 reputation"
                                                                   class="comment-user">theinsaneone</a>
                                                                <span class="comment-date" dir="ltr"><span title="2014-01-13 10:11:05Z" class="relativetime-clean">Jan 13 at 10:11</span></span>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                        <a id="comments-link-111373" data-rep=50 data-anon=true
                                           class="comments-link disabled-link"
                                           title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add comment</a>
                                    </td>
                                </tr>
                            </table>
                        </div>


                        <a name="886493"></a>
                        <div id="answer-886493" class="answer" data-answerid="886493">
                            <table>
                                <tr>
                                    <td class="votecell">


                                        <div class="vote">
                                            <input type="hidden" name="_id_" value="886493">
                                            <a class="vote-up-off" title="This answer is useful">up vote</a>
                                            <span class="vote-count-post ">1</span>
                                            <a class="vote-down-off" title="This answer is not useful">down vote</a>



                                        </div>

                                    </td>



                                    <td class="answercell">
                                        <div class="post-text">
                                            <p>I usually just test javascript performance, how long script runs. jQuery Lover gave a good article link for testing <a href="http://jquery-howto.blogspot.com/2008/12/how-to-test-javascript-performance.html" rel="nofollow"><strong>javascript code performance</strong></a>, but the article only shows how to test how long your javascript code runs. I would also recommend reading article called "5 tips on <a href="http://jquery-howto.blogspot.com/2009/02/5-easy-tips-on-how-to-improve-code.html" rel="nofollow">improving your jQuery code</a> while working with huge data sets".</p>

                                        </div>
                                        <table class="fw">
                                            <tr>
                                                <td class="vt">
                                                    <div class="post-menu"><a href="/a/886493" title="short permalink to this answer" class="short-link" id="link-post-886493">share</a><span class="lsep">|</span><a href="/posts/886493/edit" class="suggest-edit-post" title="">improve this answer</a></div>
                                                </td>



                                                <td align="right" class="post-signature">


                                                    <div class="user-info ">
                                                        <div class="user-action-time">
                                                            answered <span title="2009-05-20 06:54:27Z" class="relativetime">May 20 '09 at 6:54</span>
                                                        </div>
                                                        <div class="user-gravatar32">
                                                            <a href="/users/52317/uzbekjon"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/b3da0ca2685a59740d157b22aec70935?s=32&d=identicon&r=PG" alt=""></div></a>
                                                        </div>
                                                        <div class="user-details">
                                                            <a href="/users/52317/uzbekjon">Uzbekjon</a><br>
                                                            <span class="reputation-score" title="reputation score " dir="ltr">804</span><span title="9 silver badges"><span class="badge2"></span><span class="badgecount">9</span></span><span title="13 bronze badges"><span class="badge3"></span><span class="badgecount">13</span></span>
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>

                                <tr>
                                    <td class="votecell"></td>
                                    <td>
                                        <div id="comments-886493" class="comments  dno" data-localized="true">
                                            <table>
                                                <tbody data-remaining-comments-count="0"
                                                       data-addlink-html="add comment"
                                                       data-addlink-disabled="true">
                                                    <tr><td></td><td></td></tr>
                                                </tbody>
                                            </table>
                                        </div>
                                        <a id="comments-link-886493" data-rep=50 data-anon=true
                                           class="comments-link disabled-link"
                                           title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add comment</a>
                                    </td>
                                </tr>
                            </table>
                        </div>


                        <a name="111374"></a>
                        <div id="answer-111374" class="answer" data-answerid="111374">
                            <table>
                                <tr>
                                    <td class="votecell">


                                        <div class="vote">
                                            <input type="hidden" name="_id_" value="111374">
                                            <a class="vote-up-off" title="This answer is useful">up vote</a>
                                            <span class="vote-count-post ">0</span>
                                            <a class="vote-down-off" title="This answer is not useful">down vote</a>



                                        </div>

                                    </td>



                                    <td class="answercell">
                                        <div class="post-text">
                                            <p>The golden rule is to NOT under ANY circumstances lock your users browser. After that, I usually look at execution time, followed by memory usage (unless you're doing something crazy, in which case it could be a higher priority).</p>

                                        </div>
                                        <table class="fw">
                                            <tr>
                                                <td class="vt">
                                                    <div class="post-menu"><a href="/a/111374" title="short permalink to this answer" class="short-link" id="link-post-111374">share</a><span class="lsep">|</span><a href="/posts/111374/edit" class="suggest-edit-post" title="">improve this answer</a></div>
                                                </td>



                                                <td align="right" class="post-signature">


                                                    <div class="user-info ">
                                                        <div class="user-action-time">
                                                            answered <span title="2008-09-21 16:38:36Z" class="relativetime">Sep 21 '08 at 16:38</span>
                                                        </div>
                                                        <div class="user-gravatar32">
                                                            <a href="/users/17095/william-keller"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/e6d232754fc494bbb00e271a0e5ad538?s=32&d=identicon&r=PG" alt=""></div></a>
                                                        </div>
                                                        <div class="user-details">
                                                            <a href="/users/17095/william-keller">William Keller</a><br>
                                                            <span class="reputation-score" title="reputation score " dir="ltr">2,805</span><span title="13 silver badges"><span class="badge2"></span><span class="badgecount">13</span></span><span title="20 bronze badges"><span class="badge3"></span><span class="badgecount">20</span></span>
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>

                                <tr>
                                    <td class="votecell"></td>
                                    <td>
                                        <div id="comments-111374" class="comments  dno" data-localized="true">
                                            <table>
                                                <tbody data-remaining-comments-count="0"
                                                       data-addlink-html="add comment"
                                                       data-addlink-disabled="true">
                                                    <tr><td></td><td></td></tr>
                                                </tbody>
                                            </table>
                                        </div>
                                        <a id="comments-link-111374" data-rep=50 data-anon=true
                                           class="comments-link disabled-link"
                                           title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add comment</a>
                                    </td>
                                </tr>
                            </table>
                        </div>


                        <a name="19260977"></a>
                        <div id="answer-19260977" class="answer" data-answerid="19260977">
                            <table>
                                <tr>
                                    <td class="votecell">


                                        <div class="vote">
                                            <input type="hidden" name="_id_" value="19260977">
                                            <a class="vote-up-off" title="This answer is useful">up vote</a>
                                            <span class="vote-count-post ">0</span>
                                            <a class="vote-down-off" title="This answer is not useful">down vote</a>



                                        </div>

                                    </td>



                                    <td class="answercell">
                                        <div class="post-text">
                                            <p>This is a good way of collecting performance information for the specific operation.</p>

<pre><code>start = new Date().getTime(); 
for (var n = 0; n &lt; maxCount; n++) {
/* perform the operation to be measured *//
}
elapsed = new Date().getTime() - start;
assert(true,"Measured time: " + elapsed);
</code></pre>

                                        </div>
                                        <table class="fw">
                                            <tr>
                                                <td class="vt">
                                                    <div class="post-menu"><a href="/a/19260977" title="short permalink to this answer" class="short-link" id="link-post-19260977">share</a><span class="lsep">|</span><a href="/posts/19260977/edit" class="suggest-edit-post" title="">improve this answer</a></div>
                                                </td>



                                                <td align="right" class="post-signature">


                                                    <div class="user-info ">
                                                        <div class="user-action-time">
                                                            answered <span title="2013-10-09 00:33:41Z" class="relativetime">Oct 9 '13 at 0:33</span>
                                                        </div>
                                                        <div class="user-gravatar32">
                                                            <a href="/users/2601995/user2601995"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/9d14330a7e4f88a9818231701481f2a5?s=32&d=identicon&r=PG" alt=""></div></a>
                                                        </div>
                                                        <div class="user-details">
                                                            <a href="/users/2601995/user2601995">user2601995</a><br>
                                                            <span class="reputation-score" title="reputation score " dir="ltr">577</span><span title="1 gold badge"><span class="badge1"></span><span class="badgecount">1</span></span><span title="6 silver badges"><span class="badge2"></span><span class="badgecount">6</span></span><span title="16 bronze badges"><span class="badge3"></span><span class="badgecount">16</span></span>
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>

                                <tr>
                                    <td class="votecell"></td>
                                    <td>
                                        <div id="comments-19260977" class="comments  dno" data-localized="true">
                                            <table>
                                                <tbody data-remaining-comments-count="0"
                                                       data-addlink-html="add comment"
                                                       data-addlink-disabled="true">
                                                    <tr><td></td><td></td></tr>
                                                </tbody>
                                            </table>
                                        </div>
                                        <a id="comments-link-19260977" data-rep=50 data-anon=true
                                           class="comments-link disabled-link"
                                           title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add comment</a>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <a name='new-answer'></a>
                        <form id="post-form" action="/questions/111368/answer/submit" method="post" class="post-form">
                            <input type="hidden" id="post-id" value="111368" />
                            <input type="hidden" id="qualityBanWarningShown" name="qualityBanWarningShown" value="false" />
                            <h2 class="space">Your Answer</h2>





                            
                                StackExchange.ready(function () {
                                    initTagRenderer("".split(" "), "".split(" "));

                                    prepareEditor({
                                        heartbeatType: 'answer',
                                        bindNavPrevention: true,
                                        postfix: "",
                                        onDemand: true,
                                        discardSelector: ".discard-answer"
                                        , immediatelyShowMarkdownHelp: true
                                    });


                                });
                           


                            <div id="post-editor" class="post-editor">

                                <div style="position: relative;">
                                    <div class="wmd-container">
                                        <div id="wmd-button-bar" class="wmd-button-bar"></div>
                                        <textarea id="wmd-input" class="wmd-input" name="post-text" cols="92" rows="15" tabindex="101" data-min-length=""></textarea>
                                    </div>
                                </div>

                                <div class="fl" style="margin-top: 8px; height:24px;">&nbsp;</div>
                                <div id="draft-saved" class="draft-saved community-option fl" style="margin-top: 8px; height:24px; display:none;">draft saved</div>

                                <div id="draft-discarded" class="draft-discarded community-option fl" style="margin-top: 8px; height:24px; display:none;">draft discarded</div>



                                <div id="wmd-preview" class="wmd-preview"></div>
                                <div></div>
                                <div class="edit-block">
                                    <input id="fkey" name="fkey" type="hidden" value="c5dc5fabf5e04aa13a75c2704c3db70c">
                                    <input id="author" name="author" type="text">
                                </div>
                            </div>
                            <div style="position: relative;">

                                <div class="form-item dno new-post-login">

                                    <div class="new-login-form">
                                        <div class="new-login-left">
                                            <h3>Sign up or <a id="login-link" href="/users/login?returnurl=%2fquestions%2f111368%2fhow-do-you-performance-test-javascript-code%23new-answer">log in</a></h3>
                                            
                                                StackExchange.ready(function () {
                                                    StackExchange.helpers.onClickDraftSave('#login-link');
                                                });
                                           
                                            <div class="preferred-login google-login">
                                                <p><span class="icon"></span><span>Sign up using Google</span></p>
                                            </div>
                                            <div class="preferred-login facebook-login">
                                                <p><span class="icon"></span><span>Sign up using Facebook</span></p>
                                            </div>
                                            <div class="preferred-login stackexchange-login">
                                                <p><span class="icon"></span><span>Sign up using Stack Exchange</span></p>
                                            </div>
                                        </div>
                                        <input type="hidden" name="manual-openid" class="manual-openid" />
                                        <input type="hidden" name="use-facebook" class="use-facebook" value="false" />
                                        <input type="button" class="submit-openid" value="Submit" style="display:none" />
                                        <div class="new-login-right">
                                            <h3>Post as a guest</h3>
                                            <div class="form-item">
                                                <table>
                                                    <tr>
                                                        
                                                            StackExchange.ready(function () {
                                                                StackExchange.helpers.bindHelpOverlayEvents($('.vm input'));
                                                            });
                                                       
                                                        <td class="vm">
                                                            <div>
                                                                <label for="display-name">Name</label>
                                                                <input id="display-name" name="display-name" type="text" size="30" maxlength="30" value="" tabindex="105">
                                                            </div>
                                                            <div>
                                                                <label for="m-address">Email</label>
                                                                <input id="m-address" name="m-address" type="text" size="30" maxlength="100" value="" tabindex="106">
                                                                <span class="edit-field-overlay">required, but not shown</span>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </div>

                                        </div>
                                    </div>
                                </div>
                                
                                    StackExchange.ready(
                                        function () {
                                            StackExchange.openid.initPostLogin('.new-post-login', '%2fquestions%2f111368%2fhow-do-you-performance-test-javascript-code%23new-answer');
                                        }
                                    );
                               
                                <noscript>
                                    <h3>Post as a guest</h3>
                                    <div class="form-item">
                                        <table>
                                            <tr>
                                                
                                                    StackExchange.ready(function () {
                                                        StackExchange.helpers.bindHelpOverlayEvents($('.vm input'));
                                                    });
                                               
                                                <td class="vm">
                                                    <div>
                                                        <label for="display-name">Name</label>
                                                        <input id="display-name" name="display-name" type="text" size="30" maxlength="30" value="" tabindex="105">
                                                    </div>
                                                    <div>
                                                        <label for="m-address">Email</label>
                                                        <input id="m-address" name="m-address" type="text" size="30" maxlength="100" value="" tabindex="106">
                                                        <span class="edit-field-overlay">required, but not shown</span>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </div>

                                </noscript>
                            </div>

                            <div class="form-submit cbt">
                                <input id="submit-button" type="submit" value="Post Your Answer" tabindex="110">
                                <a href="#" class="discard-answer dno">discard</a>

                                <p class="privacy-policy-agreement">
                                    By posting your answer, you agree to the <a href='http://stackexchange.com/legal/privacy-policy' target='_blank'>privacy policy</a> and <a href='http://stackexchange.com/legal/terms-of-service' target='_blank'>terms of service</a>.
                                </p>
                                <input type="hidden" name="legalLinksShown" value="1" />
                            </div>
                        </form>



                        <h2 class="bottom-notice" data-loc="1">
                            Not the answer you&#39;re looking for?							Browse other questions tagged <a href="/questions/tagged/javascript" class="post-tag" title="show questions tagged &#39;javascript&#39;" rel="tag">javascript</a> <a href="/questions/tagged/performance" class="post-tag" title="show questions tagged &#39;performance&#39;" rel="tag">performance</a>  or <a href="/questions/ask">ask your own question</a>.
                        </h2>
                    </div>
                </div>
                <div id="sidebar" class="show-votes">
                    <div class="module question-stats">
                        <table id="qinfo">
                            <tr>
                                <td>
                                    <p class="label-key">asked</p>
                                </td>
                                <td style="padding-left: 10px">
                                    <p class="label-key" title="2008-09-21 16:35:58Z"><b>5 years ago</b></p>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <p class="label-key">viewed</p>
                                </td>

                                <td style="padding-left: 10px">
                                    <p class="label-key">
                                        <b>48236 times</b>
                                    </p>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <p class="label-key">active</p>
                                </td>
                                <td style="padding-left: 10px">
                                    <p class="label-key"><b><a href="?lastactivity" class="lastactivity-link" title="2013-10-09 00:33:41Z">8 months ago</a></b></p>
                                </td>
                            </tr>
                        </table>
                    </div>

                    
                        var ados = ados || {}; ados.run = ados.run || [];
                        ados.run.push(function () { ados_add_placement(22, 8277, "adzerk1360974287", 17).setZone(45); });
                   
                    <div class="everyonelovesstackoverflow" id="adzerk1360974287">
                    </div>
                    <div id="hireme">
                        
                            window.careers_adurl = "//careers.stackoverflow.com/gethired/js", window.careers_cssurl = "//cdn-careers.sstatic.net/careers/gethired/sidebar.min.css?v=88f3fd5e2263", window.careers_leaderboardcssurl = "{leaderboardcssurl}", window.careers_companycssurl = "//cdn-careers.sstatic.net/careers/gethired/company", window.careers_adselector = "div#hireme", StackExchange.ready(function () { $.ajax({ url: "//cdn-careers.sstatic.net/careers/gethired/loader.min.js?v=1d007afde492", dataType: "script", cache: !0 }) });       
                    </div>
                    <div style="margin-bottom: 10px;">


                        <style type="text/css">
                            #newsletter-ad {
                                width: 190px;
                                height: 250px;
                                overflow: hidden;
                                background: url('//cdn.sstatic.net/stackoverflow/img/newsletter-ad.png');
                                padding: 0 15px 0 15px;
                            }

                            #newsletter-ad-header {
                                margin-top: 60px;
                            }

                            #newsletter-ad ul {
                                margin: 1em 0 1em 1.5em;
                            }

                                #newsletter-ad ul li {
                                    margin-bottom: 5px;
                                }

                            #newsletter-signup-container {
                                text-align: center;
                            }

                            #newsletter-preview-container {
                                margin-top: 10px;
                                text-align: center;
                            }

                            #newsletter-email-input {
                                width: 200px;
                            }
                        </style>

                        
                            StackExchange.ready(function () {
                                StackExchange.newsletterAd.init();
                            });
                       

                        <div id="newsletter-ad">
                            <p id="newsletter-ad-header">Get the <b>weekly newsletter!</b></p>
                            <ul>
                                <li>Top questions and answers</li>
                                <li>Important announcements</li>
                                <li>Unanswered questions</li>
                            </ul>
                            <div id="newsletter-signup-container"><input id="newsletter-signup" type="button" value="Sign up for the newsletter" /></div>
                            <p id="newsletter-preview-container">see an <a href="http://stackexchange.com/newsletters/newsletter?site=stackoverflow.com" id="newsletter-preview">example newsletter</a></p>
                            <div class="dno">

                                <p class="privacy-policy-agreement">
                                    By subscribing, you agree to the <a href='http://stackexchange.com/legal/privacy-policy' target='_blank'>privacy policy</a> and <a href='http://stackexchange.com/legal/terms-of-service' target='_blank'>terms of service</a>.
                                </p>
                                <input type="hidden" name="legalLinksShown" value="1" />
                            </div>
                        </div>

                    </div>

                    <div class="module sidebar-linked">
                        <h4 id="h-linked">Linked</h4>
                        <div class="linked" data-tracker="lq=1">
                            <div class="spacer">
                                <a href="/q/11797246" title="Vote score (upvotes - downvotes)">
                                    <div class="answer-votes  default">1</div>
                                </a>
                                <a href="/questions/11797246/how-to-determine-which-code-is-faster" class="question-hyperlink">How to determine which code is faster?</a>
                            </div><div class="spacer">
                                <a href="/q/15391009" title="Vote score (upvotes - downvotes)">
                                    <div class="answer-votes  default">22</div>
                                </a>
                                <a href="/questions/15391009/detect-graphics-card-performance-js" class="question-hyperlink">Detect Graphics card performance - JS</a>
                            </div><div class="spacer">
                                <a href="/q/4685536" title="Vote score (upvotes - downvotes)">
                                    <div class="answer-votes  default">10</div>
                                </a>
                                <a href="/questions/4685536/how-to-check-and-test-how-much-memory-a-javascript-app-is-leaking" class="question-hyperlink">How to check and test how much memory a javascript app is leaking</a>
                            </div><div class="spacer">
                                <a href="/q/10192712" title="Vote score (upvotes - downvotes)">
                                    <div class="answer-votes answered-accepted default">6</div>
                                </a>
                                <a href="/questions/10192712/css-selectors-performance-dom-parsing" class="question-hyperlink">CSS Selectors performance, DOM Parsing</a>
                            </div><div class="spacer">
                                <a href="/q/6380627" title="Vote score (upvotes - downvotes)">
                                    <div class="answer-votes answered-accepted default">2</div>
                                </a>
                                <a href="/questions/6380627/how-to-performance-tune-a-jquery-mobile-ios-android-web-app" class="question-hyperlink">How to Performance Tune a jQuery Mobile iOS/Android Web App</a>
                            </div><div class="spacer">
                                <a href="/q/7690553" title="Vote score (upvotes - downvotes)">
                                    <div class="answer-votes  default">0</div>
                                </a>
                                <a href="/questions/7690553/javascript-switch-vs-loop-on-array" class="question-hyperlink">javascript switch vs loop on array</a>
                            </div><div class="spacer">
                                <a href="/q/18513028" title="Vote score (upvotes - downvotes)">
                                    <div class="answer-votes answered-accepted default">1</div>
                                </a>
                                <a href="/questions/18513028/how-can-i-show-a-loader-during-knockout-js-initialization" class="question-hyperlink">How can i show a &ldquo;loader&rdquo; during knockout.js initialization?</a>
                            </div><div class="spacer">
                                <a href="/q/3593294" title="Vote score (upvotes - downvotes)">
                                    <div class="answer-votes answered-accepted default">4</div>
                                </a>
                                <a href="/questions/3593294/which-methods-do-you-prefer-to-test-the-speed-of-your-javascript-and-why" class="question-hyperlink">Which methods do you prefer to test the speed of your Javascript, and why?</a>
                            </div><div class="spacer">
                                <a href="/q/11623812" title="Vote score (upvotes - downvotes)">
                                    <div class="answer-votes answered-accepted default">1</div>
                                </a>
                                <a href="/questions/11623812/how-to-find-better-implementation-of-a-function-in-javascript" class="question-hyperlink">how to find better implementation of a function in javascript</a>
                            </div><div class="spacer">
                                <a href="/q/13408180" title="Vote score (upvotes - downvotes)">
                                    <div class="answer-votes  default">0</div>
                                </a>
                                <a href="/questions/13408180/how-to-check-speed-of-javascript-code-execution" class="question-hyperlink">How to check speed of JavaScript code execution</a>
                            </div>					<div class="spacer more">
                                <a href="http://stackoverflow.com/questions/linked/111368">see more linked questions…</a>
                            </div>
                        </div>
                    </div>

                    <div class="module sidebar-related">
                        <h4 id="h-related">Related</h4>
                        <div class="related js-gps-related-questions" data-tracker="rq=1">
                            <div class="spacer">
                                <a href="/q/53738" title="Vote score (upvotes - downvotes)">
                                    <div class="answer-votes default">
                                        32
                                    </div>
                                </a><a href="/questions/53738/how-do-you-test-the-performance-of-a-website" class="question-hyperlink">How do you test the performance of a website?</a>
                            </div>
                            <div class="spacer">
                                <a href="/q/111102" title="Vote score (upvotes - downvotes)">
                                    <div class="answer-votes answered-accepted extra-large">
                                        2773
                                    </div>
                                </a><a href="/questions/111102/how-do-javascript-closures-work" class="question-hyperlink">How do JavaScript closures work?</a>
                            </div>
                            <div class="spacer">
                                <a href="/q/134845" title="Vote score (upvotes - downvotes)">
                                    <div class="answer-votes extra-large">
                                        1704
                                    </div>
                                </a><a href="/questions/134845/href-attribute-for-javascript-links-or-javascriptvoid0" class="question-hyperlink">Href attribute for JavaScript links: &ldquo;#&rdquo; or &ldquo;javascript:void(0)&rdquo;?</a>
                            </div>
                            <div class="spacer">
                                <a href="/q/221294" title="Vote score (upvotes - downvotes)">
                                    <div class="answer-votes answered-accepted extra-large">
                                        1313
                                    </div>
                                </a><a href="/questions/221294/how-do-you-get-a-timestamp-in-javascript" class="question-hyperlink">How do you get a timestamp in JavaScript?</a>
                            </div>
                            <div class="spacer">
                                <a href="/q/503093" title="Vote score (upvotes - downvotes)">
                                    <div class="answer-votes answered-accepted extra-large">
                                        2524
                                    </div>
                                </a><a href="/questions/503093/how-can-i-make-a-redirect-page-in-jquery-javascript" class="question-hyperlink">How can I make a redirect page in jQuery/JavaScript?</a>
                            </div>
                            <div class="spacer">
                                <a href="/q/901115" title="Vote score (upvotes - downvotes)">
                                    <div class="answer-votes answered-accepted extra-large">
                                        2596
                                    </div>
                                </a><a href="/questions/901115/how-can-i-get-query-string-values-in-javascript" class="question-hyperlink">How can I get query string values in JavaScript?</a>
                            </div>
                            <div class="spacer">
                                <a href="/q/1711631" title="Vote score (upvotes - downvotes)">
                                    <div class="answer-votes answered-accepted large">
                                        963
                                    </div>
                                </a><a href="/questions/1711631/how-do-i-improve-the-performance-of-sqlite" class="question-hyperlink">How do I improve the performance of SQLite?</a>
                            </div>
                            <div class="spacer">
                                <a href="/q/9271276" title="Vote score (upvotes - downvotes)">
                                    <div class="answer-votes answered-accepted large">
                                        534
                                    </div>
                                </a><a href="/questions/9271276/is-the-recommendation-to-include-css-before-javascript-invalid" class="question-hyperlink">Is the recommendation to include CSS before JavaScript invalid?</a>
                            </div>
                            <div class="spacer">
                                <a href="/q/9739414" title="Vote score (upvotes - downvotes)">
                                    <div class="answer-votes default">
                                        1
                                    </div>
                                </a><a href="/questions/9739414/how-to-performance-test-javascript-in-a-web-page-on-iphone" class="question-hyperlink">How to performance test JavaScript in a web page on iPhone?</a>
                            </div>
                            <div class="spacer">
                                <a href="/q/11227809" title="Vote score (upvotes - downvotes)">
                                    <div class="answer-votes answered-accepted extra-large">
                                        7933
                                    </div>
                                </a><a href="/questions/11227809/why-is-processing-a-sorted-array-faster-than-an-unsorted-array" class="question-hyperlink">Why is processing a sorted array faster than an unsorted array?</a>
                            </div>

                        </div>
                    </div>

                    <div id="hot-network-questions" class="module">
                        <h4>
                            <a href="//stackexchange.com/questions?tab=hot"
                               class="js-gps-track"
                               data-gps-track="posts_hot_network.click({ item_type:1, location:11 })">
                                Hot Network Questions
                            </a>
                        </h4>
                        <ul>
                            <li>
                                <div class="favicon favicon-academia" title="Academia Stack Exchange"></div><a href="http://academia.stackexchange.com/questions/22098/how-much-does-topic-and-supervisor-matter-for-honours-in-computer-science-when-t" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:415 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    How much does topic and supervisor matter for honours in computer science when the aim is ultimately to do a PhD?
                                </a>

                            </li>
                            <li>
                                <div class="favicon favicon-codegolf" title="Programming Puzzles &amp; Code Golf Stack Exchange"></div><a href="http://codegolf.stackexchange.com/questions/30051/write-a-piece-of-code-to-output-the-line-number-of-the-print-output-statement" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:200 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    Write a piece of code to output the line number of the print / output statement itself (in the form &quot;Hello World, from line X!&quot;)
                                </a>

                            </li>
                            <li>
                                <div class="favicon favicon-christianity" title="Christianity Stack Exchange"></div><a href="http://christianity.stackexchange.com/questions/29813/if-thou-shall-not-kill-is-a-commandment-how-come-god-kills-people" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:304 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    If &quot;Thou Shall not Kill&quot; is a commandment, how come God kills People?
                                </a>

                            </li>
                            <li>
                                <div class="favicon favicon-puzzling" title="Puzzling Stack Exchange"></div><a href="http://puzzling.stackexchange.com/questions/626/paying-the-troll-toll" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:559 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    Paying the Troll toll
                                </a>

                            </li>
                            <li>
                                <div class="favicon favicon-mathematica" title="Mathematica Stack Exchange"></div><a href="http://mathematica.stackexchange.com/questions/50363/graph-from-binary-matrix-not-adjacency-respecting-the-original-matrix-position" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:387 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    Graph from binary matrix (not adjacency) respecting the original matrix positions
                                </a>

                            </li>
                            <li class="dno js-hidden">
                                <div class="favicon favicon-programmers" title="Programmers Stack Exchange"></div><a href="http://programmers.stackexchange.com/questions/244363/why-is-programming-sometimes-viewed-as-a-second-rate-role" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:131 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    Why is programming sometimes viewed as a second-rate role?
                                </a>

                            </li>
                            <li class="dno js-hidden">
                                <div class="favicon favicon-electronics" title="Electrical Engineering Stack Exchange"></div><a href="http://electronics.stackexchange.com/questions/113536/how-would-one-attach-an-optical-fibre-to-a-pcb-for-a-display" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:135 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    How would one attach an optical fibre to a PCB for a display?
                                </a>

                            </li>
                            <li class="dno js-hidden">
                                <div class="favicon favicon-stackoverflow" title="Stack Overflow"></div><a href="http://stackoverflow.com/questions/24110347/what-is-the-reason-behind-the-extra-padding-in-structs" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:1 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    What is the reason behind the extra padding in structs?
                                </a>

                            </li>
                            <li class="dno js-hidden">
                                <div class="favicon favicon-music" title="Musical Practice &amp; Performance Stack Exchange"></div><a href="http://music.stackexchange.com/questions/19057/how-to-escape-the-c-major-trap-when-improvising-on-the-piano" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:240 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    How to escape the C Major trap when improvising on the piano
                                </a>

                            </li>
                            <li class="dno js-hidden">
                                <div class="favicon favicon-askubuntu" title="Ask Ubuntu"></div><a href="http://askubuntu.com/questions/480572/what-does-it-take-for-a-desktop-environment-of-my-choice-to-have-its-own-officia" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:89 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    What does it take for a desktop environment of my choice to have its own official Ubuntu derivative?
                                </a>

                            </li>
                            <li class="dno js-hidden">
                                <div class="favicon favicon-tex" title="TeX - LaTeX Stack Exchange"></div><a href="http://tex.stackexchange.com/questions/183866/tree-with-six-or-more-children" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:85 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    Tree with six or more children
                                </a>

                            </li>
                            <li class="dno js-hidden">
                                <div class="favicon favicon-scifi" title="Science Fiction &amp; Fantasy Stack Exchange"></div><a href="http://scifi.stackexchange.com/questions/58909/why-didnt-sauron-attack-the-shire-if-he-knew-a-hobbit-would-defeat-him" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:186 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    Why didn&#39;t Sauron attack the Shire if he knew a Hobbit would defeat him?
                                </a>

                            </li>
                            <li class="dno js-hidden">
                                <div class="favicon favicon-tex" title="TeX - LaTeX Stack Exchange"></div><a href="http://tex.stackexchange.com/questions/183848/how-draw-part-of-ring-or-broken-ring-in-tikz" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:85 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    How draw part of ring or broken ring in TikZ?
                                </a>

                            </li>
                            <li class="dno js-hidden">
                                <div class="favicon favicon-space" title="Space Exploration Stack Exchange"></div><a href="http://space.stackexchange.com/questions/4741/why-didnt-the-apollo-program-do-an-uncrewed-landing-ascent-rehearsal" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:508 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    Why didn&#39;t the Apollo program do an uncrewed landing/ascent rehearsal?
                                </a>

                            </li>
                            <li class="dno js-hidden">
                                <div class="favicon favicon-wordpress" title="WordPress Development Stack Exchange"></div><a href="http://wordpress.stackexchange.com/questions/148951/relative-links-for-performance" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:110 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    Relative links for performance?
                                </a>

                            </li>
                            <li class="dno js-hidden">
                                <div class="favicon favicon-blender" title="Blender Stack Exchange"></div><a href="http://blender.stackexchange.com/questions/11078/how-to-add-an-edge-without-interfering-with-other-edges" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:502 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    How to add an edge without interfering with other edges?
                                </a>

                            </li>
                            <li class="dno js-hidden">
                                <div class="favicon favicon-blender" title="Blender Stack Exchange"></div><a href="http://blender.stackexchange.com/questions/12081/create-hollow-intersecting-tubes" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:502 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    Create hollow intersecting tubes
                                </a>

                            </li>
                            <li class="dno js-hidden">
                                <div class="favicon favicon-stackoverflow" title="Stack Overflow"></div><a href="http://stackoverflow.com/questions/24109737/what-are-some-uses-of-decltypeauto" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:1 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    What are some uses of decltype(auto)?
                                </a>

                            </li>
                            <li class="dno js-hidden">
                                <div class="favicon favicon-salesforce" title="Salesforce Stack Exchange"></div><a href="http://salesforce.stackexchange.com/questions/39953/how-frequently-does-salesforce-refresh-dns-information" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:459 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    How frequently does Salesforce refresh DNS information?
                                </a>

                            </li>
                            <li class="dno js-hidden">
                                <div class="favicon favicon-softwarerecs" title="Software Recommendations Stack Exchange"></div><a href="http://softwarerecs.stackexchange.com/questions/6778/i-need-an-application-that-logs-the-time-spent-on-games" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:536 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    I need an application that logs the time spent on games
                                </a>

                            </li>
                            <li class="dno js-hidden">
                                <div class="favicon favicon-rpg" title="Role-playing Games Stack Exchange"></div><a href="http://rpg.stackexchange.com/questions/40714/how-to-make-a-fake-fortune-teller" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:122 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    How to make a fake fortune teller?
                                </a>

                            </li>
                            <li class="dno js-hidden">
                                <div class="favicon favicon-parenting" title="Parenting Stack Exchange"></div><a href="http://parenting.stackexchange.com/questions/12890/how-do-i-approach-my-13-year-old-daughters-confusion-regarding-her-sexuality" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:228 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    How do I approach my 13-year-old daughter&#39;s confusion regarding her sexuality?
                                </a>

                            </li>
                            <li class="dno js-hidden">
                                <div class="favicon favicon-english" title="English Language &amp; Usage Stack Exchange"></div><a href="http://english.stackexchange.com/questions/176776/a-single-word-name-for-the-i-dont-know-gesture" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:97 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    A single word name for the &quot;I don&#39;t know&quot; gesture
                                </a>

                            </li>
                            <li class="dno js-hidden">
                                <div class="favicon favicon-biology" title="Biology Stack Exchange"></div><a href="http://biology.stackexchange.com/questions/17980/do-women-have-testosterone" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:375 }); posts_hot_network.click({ item_type:2, location:11 })">
                                    Do women have testosterone?
                                </a>

                            </li>
                        </ul>

                        <a href="#"
                           class="show-more js-show-more js-gps-track"
                           data-gps-track="posts_hot_network.click({ item_type:3, location:11 })">
                            more hot questions
                        </a>
                    </div>
                </div>

                <div id="feed-link">
                    <div id="feed-link-text">
                        <a href="/feeds/question/111368" title="feed of this question and its answers">
                            <span class="feed-icon"></span>question feed
                        </a>
                    </div>
                </div>
                
                    StackExchange.ready(function () { $.get('/posts/111368/ivc/0b91'); });
               
                <noscript>
                    <div><img src="/posts/111368/ivc/0b91" class="dno" alt="" width="0" height="0"></div>
                </noscript><div style="display:none" id="prettify-lang">default</div>
            </div>



        </div>
    </div>
    <div id="footer" class="categories">
        <div class="footerwrap">
            <div id="footer-menu">
                <div class="top-footer-links">
                    <a href="/about">about</a>
                    <a href="/help">help</a>
                    <a href="/help/badges">badges</a>
                    <a href="http://blog.stackoverflow.com?blb=1">blog</a>
                    <a href="http://chat.stackoverflow.com">chat</a>
                    <a href="http://data.stackexchange.com">data</a>
                    <a href="http://stackexchange.com/legal">legal</a>
                    <a href="http://stackexchange.com/legal/privacy-policy">privacy policy</a>
                    <a href="http://stackexchange.com/about/hiring">jobs</a>
                    <a href="http://engine.adzerk.net/r?e=eyJhdiI6NDE0LCJhdCI6MjAsImNtIjo5NTQsImNoIjoxMTc4LCJjciI6Mjc3NiwiZG0iOjQsImZjIjoyODYyLCJmbCI6Mjc1MSwibnciOjIyLCJydiI6MCwicHIiOjExNSwic3QiOjAsInVyIjoiaHR0cDovL3N0YWNrb3ZlcmZsb3cuY29tL2Fib3V0L2NvbnRhY3QiLCJyZSI6MX0&s=hRods5B22XvRBwWIwtIMekcyNF8">advertising info</a>

                    <a onclick='StackExchange.switchMobile("on")'>mobile</a>
                    <b><a href="/contact">contact us</a></b>
                    <b><a href="http://meta.stackoverflow.com">feedback</a></b>

                </div>
                <div id="footer-sites">
                    <table>
                        <tr>
                            <th colspan=3>
                                Technology
                            </th>
                            <th>
                                Life / Arts
                            </th>
                            <th>
                                Culture / Recreation
                            </th>
                            <th>
                                Science
                            </th>
                            <th>
                                Other
                            </th>
                        </tr>
                        <tr>
                            <td>
                                <ol>
                                    <li><a href="http://stackoverflow.com" title="professional and enthusiast programmers">Stack Overflow</a></li>
                                    <li><a href="http://serverfault.com" title="professional system and network administrators">Server Fault</a></li>
                                    <li><a href="http://superuser.com" title="computer enthusiasts and power users">Super User</a></li>
                                    <li><a href="http://webapps.stackexchange.com" title="power users of web applications">Web Applications</a></li>
                                    <li><a href="http://askubuntu.com" title="Ubuntu users and developers">Ask Ubuntu</a></li>
                                    <li><a href="http://webmasters.stackexchange.com" title="pro webmasters">Webmasters</a></li>
                                    <li><a href="http://gamedev.stackexchange.com" title="professional and independent game developers">Game Development</a></li>
                                    <li><a href="http://tex.stackexchange.com" title="users of TeX, LaTeX, ConTeXt, and related typesetting systems">TeX - LaTeX</a></li>
                                </ol>
                            </td>
                            <td>
                                <ol>
                                    <li><a href="http://programmers.stackexchange.com" title="professional programmers interested in conceptual questions about software development">Programmers</a></li>
                                    <li><a href="http://unix.stackexchange.com" title="users of Linux, FreeBSD and other Un*x-like operating systems.">Unix &amp; Linux</a></li>
                                    <li><a href="http://apple.stackexchange.com" title="power users of Apple hardware and software">Ask Different (Apple)</a></li>
                                    <li><a href="http://wordpress.stackexchange.com" title="WordPress developers and administrators">WordPress Development</a></li>
                                    <li><a href="http://gis.stackexchange.com" title="cartographers, geographers and GIS professionals">Geographic Information Systems</a></li>
                                    <li><a href="http://electronics.stackexchange.com" title="electronics and electrical engineering professionals, students, and enthusiasts">Electrical Engineering</a></li>
                                    <li><a href="http://android.stackexchange.com" title="enthusiasts and power users of the Android operating system">Android Enthusiasts</a></li>
                                    <li><a href="http://security.stackexchange.com" title="Information security professionals">Information Security</a></li>
                                </ol>
                            </td>
                            <td>
                                <ol>
                                    <li><a href="http://dba.stackexchange.com" title="database professionals who wish to improve their database skills and learn from others in the community">Database Administrators</a></li>
                                    <li><a href="http://drupal.stackexchange.com" title="Drupal developers and administrators">Drupal Answers</a></li>
                                    <li><a href="http://sharepoint.stackexchange.com" title="SharePoint enthusiasts">SharePoint</a></li>
                                    <li><a href="http://ux.stackexchange.com" title="user experience researchers and experts">User Experience</a></li>
                                    <li><a href="http://mathematica.stackexchange.com" title="users of Mathematica">Mathematica</a></li>

                                    <li>
                                        <a href="http://stackexchange.com/sites#technology" class="more">
                                            more (14)
                                        </a>
                                    </li>
                                </ol>
                            </td>
                            <td>
                                <ol>
                                    <li><a href="http://photo.stackexchange.com" title="professional, enthusiast and amateur photographers">Photography</a></li>
                                    <li><a href="http://scifi.stackexchange.com" title="science fiction and fantasy enthusiasts">Science Fiction &amp; Fantasy</a></li>
                                    <li><a href="http://graphicdesign.stackexchange.com" title="professional graphic designers and non-designers trying to do their own graphic design">Graphic Design</a></li>
                                    <li><a href="http://cooking.stackexchange.com" title="professional and amateur chefs">Seasoned Advice (cooking)</a></li>
                                    <li><a href="http://diy.stackexchange.com" title="contractors and serious DIYers">Home Improvement</a></li>
                                    <li><a href="http://money.stackexchange.com" title="people who want to be financially literate">Personal Finance &amp; Money</a></li>
                                    <li><a href="http://academia.stackexchange.com" title="academics and those enrolled in higher education">Academia</a></li>

                                    <li>
                                        <a href="http://stackexchange.com/sites#lifearts" class="more">
                                            more (10)
                                        </a>
                                    </li>
                                </ol>
                            </td>
                            <td>
                                <ol>
                                    <li><a href="http://english.stackexchange.com" title="linguists, etymologists, and serious English language enthusiasts">English Language &amp; Usage</a></li>
                                    <li><a href="http://skeptics.stackexchange.com" title="scientific skepticism">Skeptics</a></li>
                                    <li><a href="http://judaism.stackexchange.com" title="those who base their lives on Jewish law and tradition and anyone interested in learning more">Mi Yodeya (Judaism)</a></li>
                                    <li><a href="http://travel.stackexchange.com" title="road warriors and seasoned travelers">Travel</a></li>
                                    <li><a href="http://christianity.stackexchange.com" title="committed Christians, experts in Christianity and those interested in learning more">Christianity</a></li>
                                    <li><a href="http://gaming.stackexchange.com" title="passionate videogamers on all platforms">Arqade (gaming)</a></li>
                                    <li><a href="http://bicycles.stackexchange.com" title="people who build and repair bicycles, people who train cycling, or commute on bicycles">Bicycles</a></li>
                                    <li><a href="http://rpg.stackexchange.com" title="gamemasters and players of tabletop, paper-and-pencil role-playing games">Role-playing Games</a></li>

                                    <li>
                                        <a href="http://stackexchange.com/sites#culturerecreation" class="more">
                                            more (21)
                                        </a>
                                    </li>
                                </ol>
                            </td>
                            <td>
                                <ol>
                                    <li><a href="http://math.stackexchange.com" title="people studying math at any level and professionals in related fields">Mathematics</a></li>
                                    <li><a href="http://stats.stackexchange.com" title="people interested in statistics, machine learning, data analysis, data mining, and data visualization">Cross Validated (stats)</a></li>
                                    <li><a href="http://cstheory.stackexchange.com" title="theoretical computer scientists and researchers in related fields">Theoretical Computer Science</a></li>
                                    <li><a href="http://physics.stackexchange.com" title="active researchers, academics and students of physics">Physics</a></li>
                                    <li><a href="http://mathoverflow.net" title="professional mathematicians">MathOverflow</a></li>

                                    <li>
                                        <a href="http://stackexchange.com/sites#science" class="more">
                                            more (7)
                                        </a>
                                    </li>
                                </ol>
                            </td>
                            <td>
                                <ol>
                                    <li><a href="http://stackapps.com" title="apps, scripts, and development with the Stack Exchange API">Stack Apps</a></li>
                                    <li><a href="http://meta.stackexchange.com" title="meta-discussion of the Stack Exchange family of Q&amp;A websites">Meta Stack Exchange</a></li>
                                    <li><a href="http://area51.stackexchange.com" title="proposing new sites in the Stack Exchange network">Area 51</a></li>
                                    <li><a href="http://careers.stackoverflow.com">Stack Overflow Careers</a></li>

                                </ol>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>

            <div id="copyright">
                site design / logo &#169; 2014 stack exchange inc; user contributions licensed under <a href="http://creativecommons.org/licenses/by-sa/3.0/" rel="license">cc by-sa 3.0</a>
                with <a href="http://blog.stackoverflow.com/2009/06/attribution-required/" rel="license">attribution required</a>
            </div>
            <div id="svnrev">
                rev 2014.6.8.1646
            </div>

        </div>
    </div>

    <div id="demo1">
        Selector 
    </div>
    <div id="demo2">
        Demo 1  
    </div>

    <div id="demo3">

    </div>


    <script src="jsu.min.js"></script>
        <script>
            alert(jsu.selectorNodeList("*").length);
        var start = +new Date();
        jsu.selectorElement("#demo1").setClassName("abc");

        jsu.StorageBrowser.set("Temp", "Storage data");
        jsu.selectorElement("#demo3").setText(jsu.StorageBrowser.get("Temp"));
        var end = +new Date();  // log end timestamp
        var diff = end - start;
        console.log("Time run: " + diff);
    </script>
</body>
</html>
